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

LibJS: Stop bytecode execution after we've encountered an exception

This commit is contained in:
Gunnar Beutner 2021-06-09 18:19:11 +02:00 committed by Andreas Kling
parent b78f1c1261
commit d198e41f74

View file

@ -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);