misalcedo / tortuga

A CGI and WCGI server for HTTP/1.1
Apache License 2.0
7 stars 0 forks source link

Prevent simple infinite recursion in the interpreter. #68

Closed misalcedo closed 2 years ago

misalcedo commented 2 years ago

The tree-walking interpreter currently allows infinite recursion in the form of:

@x = x

That code would cause the interpreter to panic with a stack overflow error.

The goal is to prevent recursion for functions with no arguments (i.e., nullary functions).

See https://en.wikipedia.org/wiki/Arity

Also n-ary functions with nullary function parameters must not recurse.

Lastly, should verify if we should recursively check for infinite recursion. In other words: should an n-ary function with n-ary function parameters that are nullary recurse (and so on recursively, how many levels deep should we check)?

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically closed because it has not had recent activity. You may re-open the issue if it is still relevant.