LibJS/JIT: Continue to outer finally before returning

Fixes #21854
This commit is contained in:
Andreas Kling 2023-11-20 00:26:25 +01:00
commit 2372584b18
Notes: sideshowbarker 2024-07-17 17:49:11 +09:00
2 changed files with 23 additions and 3 deletions

View file

@ -2899,9 +2899,14 @@ void Compiler::compile_continue_pending_unwind(Bytecode::Op::ContinuePendingUnwi
Assembler::Operand::Register(GPR1),
label_for(op.resume_target().block()));
// finish the pending return from the try block
store_vm_register(Bytecode::Register::return_value(), GPR0);
jump_to_exit();
if (auto const* finalizer = m_current_block->finalizer()) {
// The current block has its own finalizer, we have to jump there instead of returning.
m_assembler.jump(label_for(*finalizer));
} else {
// finish the pending return from the try block
store_vm_register(Bytecode::Register::return_value(), GPR0);
jump_to_exit();
}
}
static void cxx_create_lexical_environment(VM& vm)