You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`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.
Describe the bug
do-whiles within any block cause a panic ("attempt to subtract with overflow" in call_frame.rs)
To Reproduce
This JavaScript code reproduces the issue:
Another case:
But notably not:
Expected behavior
do-while should execute as expected and not panic.
Additional context
Discovered with #1902.
The text was updated successfully, but these errors were encountered: