-
-
Notifications
You must be signed in to change notification settings - Fork 413
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
[Merged by Bors] - Fix panic in do while #1968
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1968 +/- ##
=======================================
Coverage 45.87% 45.87%
=======================================
Files 206 206
Lines 17102 17102
=======================================
Hits 7846 7846
Misses 9256 9256
Continue to review full report at Codecov.
|
Hi! Thanks for the contribution!! It seems it's missing a |
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
VM implementation
|
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.
Thank you!
bors r+ |
`Node::DoWhileLoop` ast node had a buggy bytecode generation where `self.patch_jump(exit)` was called after emitting `LoopEnd` opcode. This would patch the loop exit to the instruction following the do while code, which would panic in cases where do while was enclosed in a block statement. This Pull Request fixes #1929. It changes the following: - Patch jump before emitting `Opcode::LoopEnd` - Add test which has do while statement inside a block statement to demonstrate that the change fixes the panic.
Pull request successfully merged into main. Build succeeded: |
`Node::DoWhileLoop` ast node had a buggy bytecode generation where `self.patch_jump(exit)` was called after emitting `LoopEnd` opcode. This would patch the loop exit to the instruction following the do while code, which would panic in cases where do while was enclosed in a block statement. This Pull Request fixes #1929. It changes the following: - Patch jump before emitting `Opcode::LoopEnd` - Add test which has do while statement inside a block statement to demonstrate that the change fixes the panic.
Node::DoWhileLoop
ast node had a buggy bytecode generation whereself.patch_jump(exit)
was called after emittingLoopEnd
opcode. This would patch the loop exit to the instruction following the do while code, which would panic in cases where do while was enclosed in a block statement.This Pull Request fixes #1929.
It changes the following:
Opcode::LoopEnd