Hi,

I just stumbled over a peculiar Gforth crash bug involving use of local
variables and ?EXIT:

A condensed demonstration of the crash is this code:

--8<--
  : test ( flag -- )
     0 { var }
     ?EXIT
     1 { var } ;

  false test
--8<--

I believe my Gforth was built from Git rev be3d6a82e9da5f8d9a1 (May 16
2021).  This happens for me:

--8<--
$ gforth ./crash.fs  -e bye

crash.fs:4:8: warning: redefined var
/usr/local/share/gforth/0.7.9_20210513/kernel/main.fs:0:1: warning: original 
location
in file included from *the terminal*:0:-94824890370799: 
in file included from *the terminal*:-1:1: 
crash.fs:6:7: error: Invalid memory address
false >>>test<<<
Backtrace:
crash.fs:3:4:                            0 $7FF8B56AA130 ?br
--8<--

This only happens when re-using a local variable name and only when
having the ?EXIT in between.

cheers,

David

Reply via email to