rust_lisp icon indicating copy to clipboard operation
rust_lisp copied to clipboard

Stackoverflow not caught by the interpreter

Open chebureki opened this issue 1 year ago • 2 comments

A stack overflow is not caught by the interpreter => boom crash panic Example:

; + operator just so no tailcall optimization will help out
(defun overflow () (+ 1 (overflow)))
(overflow)

Optimally, the interpreter will return an error. You could add a depth value to the Env struct. If you try to enter a new env, and the new depth exceeds a maximum stack height, it will return an error

chebureki avatar Mar 24 '23 20:03 chebureki