Re: Infinite loop with CountDirective

Keats Kirsch <[email protected]> Wed, 29 Mar 2006 11:45:58 -0500
Newsgroups gmane.comp.java.webmacro.user
Message-ID <[email protected]>
Thanks Sven.

I've gone through the code and found one other place where this loop 
could occur; the TypeDirective.  I have committed a patch for that as 
well.  There is currently no unit test for this directive; I'll try to 
add one.  (Does anybody use this?)

It occurs to me that we are still vulnerable to infinite loops with 
other Macro implementations.  I noticed in the PropertyMethod class that 
it actually tests if the Macro evaluates to itself.  This takes us one 
step further, but you could still have an infinite loop if there is a 
multiple class circular reference.  E.g., MacroA evals to MacroB which 
evals to MacroA.  It's probably not worth guarding against this somewhat 
arcane case.  What do folks think?

Keats

Sven Schliesing wrote:

> Works for me.
> I get:
> ----
> Pages:    [<!-- Undefined expression in #count directive. at 
> templates\default\forum\showBoard.wm:4.12 -->]
> ----
> if not specifying an end-value.
>
> Thanks for the quick fix!
>
> Sven
>
>
> Keats Kirsch wrote:
>
>> OK, I've committed a fixed version along with a new unit test.  
>> Please check it out and let me know if you find any problems.
>>
>> Keats
>
>




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642