1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:58:11 +00:00

LibJS: Make bytecode interpreter leave unwind context immediately

We were missing some "break" statements, causing us to actually finish
executing everything within "try" blocks before actually jumping to the
"catch" and/or "finally" blocks.
This commit is contained in:
Andreas Kling 2021-10-24 23:52:39 +02:00
parent a831cd9cc7
commit 049b755123

View file

@ -88,12 +88,15 @@ Value Interpreter::run(Executable const& executable, BasicBlock const* entry_poi
accumulator() = vm().exception()->value();
vm().clear_exception();
will_jump = true;
} else if (unwind_context.finalizer) {
break;
}
if (unwind_context.finalizer) {
block = unwind_context.finalizer;
m_unwind_contexts.take_last();
will_jump = true;
m_saved_exception = Handle<Exception>::create(vm().exception());
vm().clear_exception();
break;
}
}
if (m_pending_jump.has_value()) {