fix[lang]: filter oob array access during folding#4571
Merged
charles-cooper merged 5 commits intovyperlang:masterfrom Apr 12, 2025
Merged
fix[lang]: filter oob array access during folding#4571charles-cooper merged 5 commits intovyperlang:masterfrom
charles-cooper merged 5 commits intovyperlang:masterfrom
Conversation
constant folding was not filtering out oob array index accesses. this is because it was raising `UnfoldableNode`, which is caught by the folding machinery. this commit changes it to an `ArrayIndexException`, which will propagate to the user and abort compilation.
…olding Fork/charles cooper/fix/oob folding
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4571 +/- ##
==========================================
+ Coverage 92.66% 92.70% +0.04%
==========================================
Files 123 123
Lines 17516 17526 +10
Branches 2967 2971 +4
==========================================
+ Hits 16231 16248 +17
+ Misses 883 879 -4
+ Partials 402 399 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
cyberthirst
reviewed
Apr 11, 2025
| failing_list = [ | ||
| "MAX: constant(DynArray[uint256, 10]) = [1, 2, 3]", | ||
| "MAX: constant(uint256[3]) = [1, 2, 3]", | ||
| "MAX: constant((uint256, uint256, uint256)) = (1, 2, 3)", |
Collaborator
There was a problem hiding this comment.
note that even for tuples we raise ArrayIndexException
cyberthirst
approved these changes
Apr 11, 2025
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.
constant folding was not filtering out oob array index accesses. this is because it was raising
UnfoldableNode, which is caught by the folding machinery. this commit changes it to anArrayIndexException, which will propagate to the user and abort compilation.What I did
fix #4436
How I did it
How to verify it
Commit message
Description for the changelog
Cute Animal Picture