-
Notifications
You must be signed in to change notification settings - Fork 979
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
[Bug]: When variable is reused in two multi-return assignments, original tuple index is reused #1913
Comments
I imagine this is caused by this code in
I wonder why this code exists. Can we use |
I wonder what the if-statement was supposed to do. Removing the if-statement doesn't break any tests (as in |
Example: function test() public {
(uint a, ) = i.f();
(, a) = i.f();
} Wrong IR:
Note that the both UNPACK uses index UPDATE: |
I think |
Describe the issue:
When a variable is used to store a result of a multi-return function call and then later used to store the result of a different multi-return function call, the index of the first UNPACK operation is used for the second UNPACK. Instead, the index of the second UNPACK should be based on where the variable was listed on the lhs of the assignment.
Code example to reproduce the issue:
Version:
0.9.3
Relevant log output:
The text was updated successfully, but these errors were encountered: