Re: [RFA] Avoid recursivly defined user functions.

Daniel Jacobowitz
2002-04-09T21:05:10Z

On Tue, Apr 09, 2002 at 02:01:13PM -0700, Don Howard wrote:
> I think I can detect mutual recursion by walking through the body of each
> user-defined command (recursivly). This amounts to static recursion
> detection.
>
> I think I could track simple recursion depth at runtime.
>
> I don't see how to track mutual recursion depth at runtime. Maybe do the
> static recursion detection and recursivly flag user-defined commands in
> the body?

How about something even simpler - track user command depth at runtime?
Set an absurd limit, like 1024 deep, if we can handle that in a
normal-sized stack limit. Then complain if we hit it at runtime.

--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer