From 9330163b0bb4ab30c53be41914bbf932dc3f5d2f Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 7 Jun 2021 13:54:29 +0200 Subject: [PATCH] LibJS: Make sure the global CallFrame doesn't go out of scope The Bytecode::Interpreter will push a global call frame if needed, and it needs to make sure that call frame survives until the end of the Interpreter::run() function. --- Userland/Libraries/LibJS/Bytecode/Interpreter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp b/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp index 121b2ca066..4d63cafeb7 100644 --- a/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp +++ b/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp @@ -36,8 +36,8 @@ Value Interpreter::run(Bytecode::Block const& block) { dbgln("Bytecode::Interpreter will run block {:p}", &block); + CallFrame global_call_frame; if (vm().call_stack().is_empty()) { - CallFrame global_call_frame; global_call_frame.this_value = &global_object(); static FlyString global_execution_context_name = "(*BC* global execution context)"; global_call_frame.function_name = global_execution_context_name;