-
-
Notifications
You must be signed in to change notification settings - Fork 836
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
fix[ux]: catch state modifying functions in range expr and loop iterator #3884
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3884 +/- ##
==========================================
- Coverage 92.06% 92.06% -0.01%
==========================================
Files 120 120
Lines 17335 17352 +17
Branches 2935 2940 +5
==========================================
+ Hits 15960 15975 +15
- Misses 957 958 +1
- Partials 418 419 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting that we don't need (as much) analysis anymore. but i'm not sure this works for side effecting expressions which aren't marked with extcall (e.g. raw_call, internal calls which result in state changes, etc). i think a more robust solution is going to be to pass around a context variable with the current scope's modifiability information
this is a dup of #3546 no? |
interface I:
def bar() -> DynArray[uint256, 10]: nonpayable
@external
def bar(t: address):
for i: uint256 in extcall I(t).bar():
pass
|
@@ -614,6 +614,19 @@ def foo(_addr: address): | |||
( | |||
""" | |||
@external | |||
def foo(a: address): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a test for raw call because it has its own analysis in its build_IR
function. Can I move these syntax tests to tests/functional/syntax/test_raw_call.py
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
What I did
Fix #3172, #3504, #3867. Closes #3188.
How I did it
Check for modifying member and contract functions in a range call and as loop iterator.
How to verify it
See tests.
Commit message
Description for the changelog
Cute Animal Picture