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

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.
This commit is contained in:
Andreas Kling 2021-06-07 13:54:29 +02:00
parent 0cc9d47e1b
commit 9330163b0b

View file

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