The current translation of ret deletes it entirely, which is only valid if it's the last instruction in the program.
For example, the x86 idiom
je L1
ret
L1:
currently ends up
je L1
L1:
which is patently wrong.
Ideally, we should inject an 'end of program' label, convert ret to an unconditional jump to that label, and then perform dead-label analysis to remove the label again if needed.
The current translation of
ret
deletes it entirely, which is only valid if it's the last instruction in the program.For example, the x86 idiom
currently ends up
which is patently wrong.
Ideally, we should inject an 'end of program' label, convert
ret
to an unconditional jump to that label, and then perform dead-label analysis to remove the label again if needed.