fix[venom]: fix _stack_reorder() routine#4220
Merged
charles-cooper merged 13 commits intovyperlang:masterfrom Oct 4, 2024
Merged
fix[venom]: fix _stack_reorder() routine#4220charles-cooper merged 13 commits intovyperlang:masterfrom
_stack_reorder() routine#4220charles-cooper merged 13 commits intovyperlang:masterfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4220 +/- ##
==========================================
- Coverage 91.36% 89.02% -2.35%
==========================================
Files 108 108
Lines 15637 15655 +18
Branches 3440 3445 +5
==========================================
- Hits 14287 13937 -350
- Misses 920 1213 +293
- Partials 430 505 +75
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
vyper/venom/venom_to_assembly.py
Outdated
| insort(positions[stack.peek(0)], depth) | ||
|
|
||
| cost += self.swap(assembly, stack, depth) | ||
| if final_stack_depth in positions[stack.peek(final_stack_depth)]: |
Member
There was a problem hiding this comment.
i think the positions[stack.peek(final_stack_depth)] can be factored out into a variable
_stack_reorder() routine
charles-cooper
approved these changes
Oct 4, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
Fixed the issue that was manifested in the snekmate test. This bug is reported in #4215
How I did it
The bug was caused by error in
stack_reorderfunction. The function depends on the order of each operand but since the order changes there is the possibility to move same stack operand twice. To fix this issue I kept the information where necessary operands on stack.How to verify it
The example from the issue does compile now.
Commit message
Description for the changelog
Cute Animal Picture