mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-05 22:52:10 +02:00
LibJS: Stop bytecode execution after we've encountered an exception
This commit is contained in:
committed by
Andreas Kling
parent
b78f1c1261
commit
d198e41f74
@@ -65,6 +65,8 @@ Value Interpreter::run(Executable const& executable)
|
||||
while (!pc.at_end()) {
|
||||
auto& instruction = *pc;
|
||||
instruction.execute(*this);
|
||||
if (vm().exception())
|
||||
break;
|
||||
if (m_pending_jump.has_value()) {
|
||||
block = m_pending_jump.release_value();
|
||||
will_jump = true;
|
||||
@@ -82,6 +84,9 @@ Value Interpreter::run(Executable const& executable)
|
||||
|
||||
if (pc.at_end() && !will_jump)
|
||||
break;
|
||||
|
||||
if (vm().exception())
|
||||
break;
|
||||
}
|
||||
|
||||
dbgln_if(JS_BYTECODE_DEBUG, "Bytecode::Interpreter did run unit {:p}", &executable);
|
||||
|
||||
Reference in New Issue
Block a user