mipsy
mipsy copied to clipboard
branches to label outside > 16-bit offset range not detected
$ (printf 'main:b end\n';yes nop|sed 32767q;printf 'end:jr $ra') >a.s
$ 1521 mipsy a.s
error: segmentation fault
this happened because you tried to execute
the address `0x003e0000`, which is not a valid address to execute
the instruction that got us here was:
0x00400000 1 [0x10008000] beq $zero, $zero, -32768 # main:b end
tip: the address `0x003e0000` is not part of any segment
evil...
this issue also applies to j
family range also