Open mateon1 opened 6 years ago
I usually use rr to debug the generate code, as you can walk the code execution backward.
I can reproduce this issue. I got a SEGV which corresponds to the panic with the message "Unknown Symbol". The problem likely comes from the code which is being produced by the array access[1], which is probably always checked, but never appear in the MIR.
With this program
eval(jc, "-[>-[>-<-]<-]<-]".into())
, the brainfuck interpreter panics, because it sees an unknown symbol at the program counter (garbage memory) Witheval(jc, "-[>-[>-[>-<-]<-]<-]<-]".into())
- the program receives a SIGSEGV, caused by a read of one byte before an allocated page.I'll try to run these with ASAN and report the results
EDIT: I can't build with ASAN,
because. Brainfart, I need to pass thekernel32-sys
fails to link--target
flag, butholyjit
also fails to link. EDIT2: I just realized the brackets in these programs are mismatched, which means bounds checks aren't emitted properly under jit!()