-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Compiler-v2] Fix bug in assign_unpack_references #12575
Conversation
⏱️ 4h 42m total CI duration on this PR
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #12575 +/- ##
===========================================
- Coverage 69.9% 64.0% -6.0%
===========================================
Files 2285 817 -1468
Lines 432040 181066 -250974
===========================================
- Hits 302391 115925 -186466
+ Misses 129649 65141 -64508 ☔ 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.
LGTM, nice fix!
@@ -1264,14 +1264,15 @@ impl<'env> Generator<'env> { | |||
} else { | |||
ReferenceKind::Mutable | |||
}; | |||
return self.gen_borrow_field_for_unpack_ref(id, str, arg, temps, ref_kind); | |||
self.gen_borrow_field_for_unpack_ref(id, str, arg, temps, ref_kind); |
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.
Was the bug here really that the loop on 1276 wasn't run for this case?
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.
There are two issues, one is the loop wasn't run. The other one is that the type of struct pattern should be & instead of the struct type when unpacking a reference of a struct, which is fixed in the exp_builder.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
Description
This PR fixes the bug revealed in the test case
/simplifier-elimination/assign_unpack_references.move
by 1) changing the type of nodeId generated for the Unpack operation; 2) fixing a bug in the bytecode_generator to recursively handle struct pattern when the unpack target is reference.Type of Change
Which Components or Systems Does This Change Impact?
How Has This Been Tested?
The fix can be validated by the output change in existing tests. Also added a transactional test
assign_unpack_references
.Key Areas to Review
Checklist