POV-Ray : Newsgroups : povray.bugreports : #write : Re: #write Server Time
4 May 2024 19:12:34 EDT (-0400)
  Re: #write  
From: Le Forgeron
Date: 2 Mar 2016 05:17:37
Message: <56d6bdc1@news.povray.org>
Le 02/03/2016 08:25, clipka a écrit :
> Am 01.03.2016 um 23:08 schrieb Le_Forgeron:
>
>> The heap is exhausted
>
> I presume you mean "stack", right?


yes... and I was tired also, because it's 4 functions calls per 
iteration, not 2, so the stack size would need a x10...

>
>> NAAAAHHH, Parse_Write should use a pattern already use elsewhere, no more than one
recursion... or even none at all.
>
> That would plug up only one of a guesstimated 4711 ways to coax the
> POV-Ray parser into recursive calls.
>
> Wanna bet that "#write" does the very same thing?
>
> I think it would be more sensible to impose some arbitrary upper limit
> to the nesting of Get_Token() calls; that would at least catch one
> entire family of those 4711 ways.
>

Beware to not stop code that stacks #local and other in the middle of 
valid statement, including themself. limiting to #write (and #read) at 
least have a smaller impact.

OTOH, I never was fan of "smart" code.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.