ams-hackers / gbforth

👾 A Forth-based Game Boy development kit
https://gbforth.org
MIT License
128 stars 24 forks source link

Crash due to extraneous parenthesis #339

Closed fgaz closed 1 year ago

fgaz commented 1 year ago

This parenthesis:

https://github.com/ams-hackers/gbforth/blob/dd0188c8dd7834ea48a50f5a1a796887912161a0/src/compiler/cross.fs#L98-L99

causes the following error on gforth 0.7.9

$ ./gbforth examples/hello-world/hello.fs 

in file included from *the terminal*:0:-17651951:                                                                                       
in file included from *the terminal*:-1:1:                                                                                              
in file included from gbforth:2:9:                                                                                                      
in file included from gbforth.fs:15:9:                                                                                                  
src/compiler/cross.fs:99:1: error: Stack underflow                                                                                      
>>>)<<<                                                                                                                                 
Backtrace:                                                                                                                              
/nix/store/w9p1rpcndmy2p6ss78ilf15xx7p1d2av-gforth-0.7.9_20220127/share/gforth/0.7.9_20220127/assert.fs:51:19:  0 $7F48C8D4C050 <> 

cc @davazp

tkers commented 1 year ago

Interesting, I don't think assert.fs was included by default in v0.7.3 (at least that's what the error seems to point towards).

This should be easy to fix by just placing the closing bracket on the same line as the comment, which is definitely a no-op for Forth but should trick most syntax highlighting correctly :)

Will push a fix in a bit, thanks for reporting this @fgaz !