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:
parent
a831cd9cc7
commit
049b755123
1 changed files with 4 additions and 1 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue