-
Notifications
You must be signed in to change notification settings - Fork 6.3k
[Yul] Fix registration of functions in scopes. #6456
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
Conversation
|
I reran the fuzzer on this patch and it told me that the following assembly code compiles fine, but optimization throws an exception Assertion is thrown here The (optimized) code at the time assertion is thrown is the following I tried to print the errorList at the time this happened and it returned the following text Since the errors don't match either the original source or the optimized source, I don't know what to make of it. General question: What do scoping rules say about Is |
a40d020 to
d1dcc77
Compare
|
Ready for review. Fixed another might-be-bug. |
|
Yes, that should be fixed, now, too @bshastry |
|
The scoping rules were not implemented correctly: https://solidity.readthedocs.io/en/latest/yul.html#scoping-rules
Visible means "defined in the same block as the function (or a common parent block)". Accessible means "visible and reaching to it does not cross function boundaries". |
Okay, will rerun the fuzzer on the diff |
So in the previous example (reproducing for convenience)
Ah, I see why the original test input which is led to problems. |
|
Please rebase and squash. |
ekpyron
left a comment
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.
Took me a while to understand what's happening here, but now it looks good to me!
|
Ah, it's a compilation test failing in both runs (i.e. linux and mac) due to an additional scope... |
|
Which is due to running the function grouper, so it's fine and only the test expectations need to be updated. |
d1dcc77 to
804c155
Compare
|
Rebased and updated some expectations. |
ekpyron
left a comment
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.
Fine, if the tests are passing.
Codecov Report
@@ Coverage Diff @@
## develop #6456 +/- ##
===========================================
+ Coverage 87.85% 87.86% +<.01%
===========================================
Files 387 387
Lines 37938 37942 +4
Branches 4474 4473 -1
===========================================
+ Hits 33331 33336 +5
+ Misses 3070 3069 -1
Partials 1537 1537
|
Fixes #6446