summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS
diff options
context:
space:
mode:
authorHendiadyoin1 <leon.a@serenityos.org>2022-11-08 19:38:57 +0100
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2022-12-03 17:07:30 +0330
commitb86f1c2fe7b304f44c72533a6e08ecf615f0fc90 (patch)
tree1432d16e07c2ba18a92c74aa8eff91692a2b2e8c /Userland/Libraries/LibJS
parenta00c421d61ee05edfcaaeac0af39c2d775cb150d (diff)
downloadserenity-b86f1c2fe7b304f44c72533a6e08ecf615f0fc90.zip
LibJS: Restore cached current_block on return in Bytecode
Otherwise debug prints will show the wrong block until we preform a jump
Diffstat (limited to 'Userland/Libraries/LibJS')
-rw-r--r--Userland/Libraries/LibJS/Bytecode/Interpreter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp b/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp
index 41eb283228..428b0f3be6 100644
--- a/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp
+++ b/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp
@@ -61,7 +61,8 @@ Interpreter::ValueAndFrame Interpreter::run_and_return_frame(Executable const& e
pushed_execution_context = true;
}
- m_current_block = entry_point ?: &executable.basic_blocks.first();
+ TemporaryChange restore_current_block { m_current_block, entry_point ?: &executable.basic_blocks.first() };
+
if (in_frame)
m_register_windows.append(in_frame);
else