Find limit of recursion: Difference between revisions

Content added Content deleted
(Add LIL)
Line 1,425: Line 1,425:
gosub [test]
gosub [test]
</lang>
</lang>

=={{header|LIL}}==
lil.c allows an option build value to set a limit on recursion:
<lang c>/* Enable limiting recursive calls to lil_parse - this can be used to avoid call stack
* overflows and is also useful when running through an automated fuzzer like AFL */
/*#define LIL_ENABLE_RECLIMIT 10000*/</lang>

Otherwise, it is a race to run out of stack:

{{out}}
<pre>Little Interpreted Language Interactive Shell
# func recur {n} {print $n; inc n; recur $n}
recur
# recur
1
2
...
37323
37324
Segmentation fault (core dumped)</pre>

That number will varying depending on system and state of system.


=={{header|Logo}}==
=={{header|Logo}}==