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:
parent
b78f1c1261
commit
d198e41f74
1 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue