-
-
Notifications
You must be signed in to change notification settings - Fork 795
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[codegen]: fix make_setter
overlap in dynarray_append
#4059
fix[codegen]: fix make_setter
overlap in dynarray_append
#4059
Conversation
make_setter can potentially run into overlap when called from dynarray_append; this commit copies to a temporary intermediate buffer before copying to the destination if the condition is detected. this commit also adds a util function to detect overlap, and adds an assertion directly in `make_setter` so that future variants panic instead of generating bad code.
currently we don't handle ann_assign well this will panic interface Bar:
def bar() -> Bytes[2]: payable
@external
def foo() -> Bytes[2]:
x: Bytes[2] = extcall Bar(self).bar()
return x |
also this due to the internal buffer variable on lhs BLUEPRINT: immutable(address)
@deploy
def __init__(blueprint_address: address):
BLUEPRINT = blueprint_address
@external
def test(code_ofst: uint256) -> address:
return create_from_blueprint(BLUEPRINT, code_offset=code_ofst) |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4059 +/- ##
===========================================
- Coverage 91.23% 55.21% -36.03%
===========================================
Files 108 107 -1
Lines 15499 15466 -33
Branches 3404 3401 -3
===========================================
- Hits 14141 8540 -5601
- Misses 927 6304 +5377
- Partials 431 622 +191 ☔ View full report in Codecov by Sentry. |
make_setter
overlap in dynarray_append
What I did
fix #4056, which is another make_setter overlap bug
variant of #4037 and #3410
additionally adds an internal assertion to prevent future variants
How I did it
How to verify it
Commit message
Description for the changelog
Cute Animal Picture