Align Yul interpreter with Solidity semantics#84
Draft
danrobinson wants to merge 4 commits into
Draft
Conversation
66633c5 to
355d10e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This aligns several Yul interpreter behaviors with Solidity's Yul semantics:
switchnow executes only the selected case body, or the default body when no case matches.default {}equivalence.let x := ...andx := ...no longer have the same AST/semantics.0, instead of propagatingRevertas an interpreter error.SELFDESTRUCTnow halts execution after applying the existing modelled account and substate effects.This does not attempt to fully remodel
SELFDESTRUCT. The existing limitations around account/external-interaction behavior remain, including not triggering fallback behavior on a recipient contract and not claiming a full account-lifecycle model for all post-Cancun/EIP-6780 cases.Regression tests
Added focused Yul semantics tests covering:
switchcase with a reverting default branch;callto a reverting callee returning0;SELFDESTRUCTpreventing following code from executing.Testing