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

LegacyVM with optimizations reports incorrect opcodes in trace #5847

@gumb0

Description

@gumb0

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions