3 ms·
A fixpoint algorithm for translating labels to absolute addresses. Nothing new, but I’m still proud of it. For this architecture, the size of a jump depends on
by sshine 3y ago
A fixpoint algorithm for translating labels to absolute addresses. Nothing new, but I’m still proud of it.
For this architecture, the size of a jump depends on the address, which is not known until labels have been converted. Converting a label may trigger a cascade in offsets.
I was working on a compiler where all jumps used the maximum possible size (zero-padding the address) instead of 2-4 bytes in order to avoid solving this problem.
https://github.com/sshine/evm-opcodes/#accounts-for-size-of-pushes-when-doing-absolute-jumps https://github.com/sshine/evm-opcodes/#accounts-for-size-of-...