Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

LegacyVM with optimizations reports incorrect opcodes in trace #5847

Closed
gumb0 opened this issue Nov 22, 2019 · 0 comments · Fixed by #5852
Closed

LegacyVM with optimizations reports incorrect opcodes in trace #5847

gumb0 opened this issue Nov 22, 2019 · 0 comments · Fixed by #5852

Comments

@gumb0
Copy link
Member

gumb0 commented Nov 22, 2019

See #5804 (comment)

LegacyVM has optimizations (enabled by default) which need to replace all PUSH6-PUSH32, JUMP, JUMPI opcodes in the original code with synthetic opcodes PUSHC, JUMPC, JUMPCI before the execution.

The problem is that during execution opcode callback gets these synthetic opcodes, this results in VM trace showing them instead of the original ones.

I think this can be fixed by calling the callback in the case of PUSHC, JUMPC, JUMPCI with original opcode instead of m_OP.
The original PUSH can be found from m_code[PUSHC_offset + 3], see

m_code[pc+3] = nPush - 2;

The workaround disabling optimizations is cmake .. -DEVM_OPTIMIZE=OFF

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant