mirror of
https://github.com/RGBCube/serenity
synced 2025-06-28 21:02:07 +00:00
LibJS: Fix codegen for nodes after try statements without 'finally'
Previously we were just dropping them on the ground :P
This commit is contained in:
parent
5a38f86f1b
commit
b96118b5d1
4 changed files with 43 additions and 2 deletions
|
@ -1189,8 +1189,15 @@ void TryStatement::generate_bytecode(Bytecode::Generator& generator) const
|
|||
|
||||
generator.switch_to_basic_block(target_block);
|
||||
m_block->generate_bytecode(generator);
|
||||
if (m_finalizer && !generator.is_current_block_terminated())
|
||||
generator.emit<Bytecode::Op::Jump>(finalizer_target);
|
||||
if (!generator.is_current_block_terminated()) {
|
||||
if (m_finalizer) {
|
||||
generator.emit<Bytecode::Op::Jump>(finalizer_target);
|
||||
} else {
|
||||
auto& block = generator.make_block();
|
||||
generator.emit<Bytecode::Op::FinishUnwind>(Bytecode::Label { block });
|
||||
next_block = █
|
||||
}
|
||||
}
|
||||
|
||||
generator.switch_to_basic_block(next_block ? *next_block : saved_block);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue