fix[lang]: disallow staticcall in pure context#4619
Merged
charles-cooper merged 6 commits intovyperlang:masterfrom Apr 30, 2025
Merged
fix[lang]: disallow staticcall in pure context#4619charles-cooper merged 6 commits intovyperlang:masterfrom
charles-cooper merged 6 commits intovyperlang:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4619 +/- ##
==========================================
- Coverage 92.50% 92.49% -0.01%
==========================================
Files 128 128
Lines 18510 18521 +11
Branches 3208 3210 +2
==========================================
+ Hits 17122 17131 +9
- Misses 944 945 +1
- Partials 444 445 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| """ | ||
| @pure | ||
| def foo(a: address): | ||
| x: Bytes[32] = raw_call(a, b'', max_outsize=32, is_static_call=True or False) |
Member
There was a problem hiding this comment.
nice -- please add comment saying this is to test constant folding
vyper/semantics/analysis/local.py
Outdated
| self._check_call_mutability(func_type.mutability) # type: ignore | ||
| from vyper.builtins.functions import RawCall | ||
|
|
||
| # opposed to other funs, raw_call's mutability depends on its arguments |
Member
There was a problem hiding this comment.
Suggested change
| # opposed to other funs, raw_call's mutability depends on its arguments | |
| # as opposed to other functions, raw_call's mutability depends on its arguments |
vyper/semantics/analysis/local.py
Outdated
|
|
||
| self.visit(node.func, func_type) | ||
|
|
||
| def get_raw_call_mutability(self, node: vy_ast.Call): |
Member
There was a problem hiding this comment.
this method should rather be on RawCall
charles-cooper
approved these changes
Apr 30, 2025
Member
charles-cooper
left a comment
There was a problem hiding this comment.
looks good, just some small changes
Collaborator
Author
|
the recent changes seem good |
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.
What I did
puremutability context #3093Commit Message
How to verify it