tinyjit
tinyjit copied to clipboard
Assembler bug on call instructions
First of all, thank you for writing this blog post in such incredible detail!
From what I understand, there is a bug in the assembling of call instructions, which causes the target to be one byte lower than the correct address.
Current implementation computes src
address after emiting the opcode byte 0xE8
:
emit [0xE8]
src <- gets _memoff
imm (dst - (src + 5))
I believe that src <- gets _memoff
should happen prior to emit [0xE8]