From 7fef8c5648769090de9df44ee324cc4a72f1c5aa Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 24 Jun 2021 20:10:31 +0200 Subject: [PATCH] LibJS: Protect execution context variable environments from GC At the moment these environments are always the same as the lexical ones, so this didn't cause any trouble. Once we start separating them we have to make sure both environments are protected. --- Userland/Libraries/LibJS/Runtime/VM.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Libraries/LibJS/Runtime/VM.cpp b/Userland/Libraries/LibJS/Runtime/VM.cpp index 4a032b732f2..cd6fd9f65c5 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.cpp +++ b/Userland/Libraries/LibJS/Runtime/VM.cpp @@ -106,6 +106,7 @@ void VM::gather_roots(HashTable& roots) roots.set(&argument.as_cell()); } roots.set(execution_context->lexical_environment); + roots.set(execution_context->variable_environment); } #define __JS_ENUMERATE(SymbolName, snake_name) \