HomeThat World

core/asm: assembly parser label fixes (#20210)

Authored by Michael Forney <mforney@mforney.org> on Oct 29 2019, 12:47 PM.

Description

core/asm: assembly parser label fixes (#20210)

  • core/asm: Fix encoding of pushed labels

EVM uses big-endian byte-order, so to pad a label value to 4 bytes,
zeros must be added to the front, not the end.

  • core/asm: Fix PC calculations when a label is pushed

Incrementing PC by 5 is only correct if the label appears after a jump,
in which case there is an implicit push. When it appears after an explicit
push, PC should only be incremented by 4.

  • core/asm: Allow JUMP with no argument

This way, a label can be pushed explicitly, or loaded from memory to
implement a jump table.

Details

Committed
Felix Lange <fjl@twurst.com>Oct 29 2019, 12:47 PM
Parents
rGETHecdbb402ee08: trie: remove node ordering slice in sync batch (#19929)
Branches
Unknown
Tags
Unknown

Event Timeline

Felix Lange <fjl@twurst.com> committed rGETHb0b277525cb4: core/asm: assembly parser label fixes (#20210) (authored by Michael Forney <mforney@mforney.org>).Oct 29 2019, 12:47 PM