Disallow code sections unreachable from section 0#866
Merged
gumb0 merged 1 commit intoipsilon:masterfrom Apr 26, 2024
Merged
Conversation
Contributor
hugo-dc
commented
Apr 16, 2024
- Validates the code by using a worklist of accessed code sections
- At the end if any code section was not accessed will return unreachable_code_sections error.
- Fixes tests previously containing unreachable code sections
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #866 +/- ##
=======================================
Coverage 98.37% 98.38%
=======================================
Files 129 129
Lines 15536 15559 +23
=======================================
+ Hits 15284 15307 +23
Misses 252 252
Flags with carried forward coverage won't be shown. Click here to find out more.
|
20da468 to
04a0259
Compare
rodiazet
reviewed
Apr 19, 2024
gumb0
reviewed
Apr 22, 2024
gumb0
reviewed
Apr 22, 2024
gumb0
reviewed
Apr 22, 2024
04a0259 to
8b5e65a
Compare
gumb0
reviewed
Apr 24, 2024
lib/evmone/eof.cpp
Outdated
| for (size_t code_idx = 0; code_idx < header.code_sizes.size(); ++code_idx) | ||
| while (!code_sections_worklist.empty()) | ||
| { | ||
| auto code_idx = code_sections_worklist.front(); |
Member
There was a problem hiding this comment.
Suggested change
| auto code_idx = code_sections_worklist.front(); | |
| const auto code_idx = code_sections_worklist.front(); |
Member
|
Please rebase |
f8cc612 to
cb00a79
Compare
cb00a79 to
e8626d2
Compare
Contributor
Author
|
Rebased. Added a couple of tests for unreachable code sections in subcontainers. |
gumb0
approved these changes
Apr 26, 2024
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.