Skip to content

enter only via jumpsub#2646

Merged
eip-automerger merged 1 commit intomasterfrom
jumpsub
May 15, 2020
Merged

enter only via jumpsub#2646
eip-automerger merged 1 commit intomasterfrom
jumpsub

Conversation

@gcolvin
Copy link
Contributor

@gcolvin gcolvin commented May 15, 2020

As proposed by Pawel, Andrei and Alex @chfast @gumb0 @axic

Change the specification in a way that BEGINSUB can only be reached via JUMPSUB . >
Specifically:

  1. Execution of BEGINSUB causes exception (OOG: all gas consumed) and terminates execution. This way BEGINSUB behaves like INVALID (aka 0xfe ) and it should never be executed in a well-formed EVM program.
  2. JUMPSUB sets the pc to location + 1 ( As opposed to location in the current spec ).
  3. In the edge case when BEGINSUB is the last instruction in code and this subroutine is jumped-to, the implementations should execute STOP . This is consistent with the other similar case of returning from a subroutine jumped-to from the JUMPSUB being the last instruction in code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants