Skip to content

Jitted code doesn't check if slice index is in bounds #19

@mateon1

Description

@mateon1

With this program eval(jc, "-[>-[>-<-]<-]<-]".into()), the brainfuck interpreter panics, because it sees an unknown symbol at the program counter (garbage memory)
With eval(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 kernel32-sys fails to link. Brainfart, I need to pass the --target flag, but holyjit 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!()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions