mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-16 23:31:55 +00:00
LibJS: Make EnterUnwindContext a terminator op
Otherwise a basic block could have multiple outgoing edges without having much reason to do so.
This commit is contained in:
parent
e73b142a97
commit
4c7c7c38e2
Notes:
sideshowbarker
2024-07-18 12:13:16 +09:00
Author: https://github.com/alimpfard
Commit: 4c7c7c38e2
Pull-request: https://github.com/SerenityOS/serenity/pull/8023
Reviewed-by: https://github.com/awesomekling
3 changed files with 11 additions and 3 deletions
|
@ -991,8 +991,11 @@ void TryStatement::generate_bytecode(Bytecode::Generator& generator) const
|
|||
}
|
||||
}
|
||||
|
||||
auto& target_block = generator.make_block();
|
||||
generator.switch_to_basic_block(saved_block);
|
||||
generator.emit<Bytecode::Op::EnterUnwindContext>(handler_target, finalizer_target);
|
||||
generator.emit<Bytecode::Op::EnterUnwindContext>(Bytecode::Label { target_block }, handler_target, finalizer_target);
|
||||
|
||||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue