Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enter only via jumpsub #2646

Merged
merged 1 commit into from
May 15, 2020
Merged

enter only via jumpsub #2646

merged 1 commit into from
May 15, 2020

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