-
Notifications
You must be signed in to change notification settings - Fork 471
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
AVM: Switch opcode #4458
Merged
Merged
AVM: Switch opcode #4458
Conversation
This file contains 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
jannotti
reviewed
Aug 24, 2022
jannotti
reviewed
Aug 25, 2022
jannotti
reviewed
Aug 25, 2022
jannotti
reviewed
Aug 25, 2022
jannotti
reviewed
Aug 25, 2022
Codecov Report
@@ Coverage Diff @@
## master #4458 +/- ##
==========================================
+ Coverage 55.27% 55.29% +0.02%
==========================================
Files 398 398
Lines 50366 50440 +74
==========================================
+ Hits 27839 27891 +52
- Misses 20198 20213 +15
- Partials 2329 2336 +7
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
jannotti
reviewed
Sep 9, 2022
jannotti
reviewed
Sep 9, 2022
algochoi
reviewed
Sep 14, 2022
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.
PR to generate docs for the new opcode: algoidurovic#2
Moved opcode number to be by other "strange jumps" Added simple tests for normal cases, and for fallthrough Added some overflow protection from handcrafted bytecode by limiting switch labels to 2^16.
…_pr_review Feedback on #3 for switchi fall-through
Made some changes to cast the label count (numOffsets) to `int` sooner. My bug was multiplying numOffsets by 2 while it was still a byte and _then_ casting to int. It had already wrapped.
Allow fall-through in switch
change name to switch. we've agreed next one would be `match`
algochoi
reviewed
Sep 16, 2022
algochoi
approved these changes
Sep 16, 2022
2 tasks
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.
Adding new
switch
opcode that contains a variable size list of label references, akatargets
. Consumes one integer from the top of the stackA
and branches totargets[A]
.Test Plan
Assembly and evaluation unit tests.