sasagawa888 / eisl

ISLisp interpreter/compiler
Other
267 stars 22 forks source link

Modified stok buffer to be dynamically resized #282

Closed gtnoble closed 1 year ago

gtnoble commented 1 year ago

Tokenizing long lexemes would cause eisl to crash due to overflowing the stok.buf buffer. I modified stok to have a dynamically resized buffer which can accommodate arbitrarily sized lexemes.

This change caused the compiler to crash due to bugs in f_unwind_protect and has_danger_p. The original code would recursively check the car of forms, but a form with a cons as the car can't be evaluated. I modified it so that it only checks if the car of the evaluated forms matches the forbidden symbols.

sasagawa888 commented 1 year ago

Thank you.

gtnoble commented 1 year ago

a form with a cons as the car can't be evaluated.

This is not true, but seems to be an uncommon case:

>>((car (list #'print )) "hello")
"hello"
NIL

I intend to revisit this to be more comprehensive.

sasagawa888 commented 1 year ago

Thank you.