diff options
author | Andreas Kling <kling@serenityos.org> | 2021-06-24 20:10:31 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-24 20:10:31 +0200 |
commit | 7fef8c5648769090de9df44ee324cc4a72f1c5aa (patch) | |
tree | 191d115cd3df8613ef289a1a7563cedee4475487 /Userland/Libraries/LibJS/Runtime | |
parent | ee3a73ddbb90f6ebab22e099c34e1aae400a81d1 (diff) | |
download | serenity-7fef8c5648769090de9df44ee324cc4a72f1c5aa.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/VM.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/VM.cpp b/Userland/Libraries/LibJS/Runtime/VM.cpp index 4a032b732f..cd6fd9f65c 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.cpp +++ b/Userland/Libraries/LibJS/Runtime/VM.cpp @@ -106,6 +106,7 @@ void VM::gather_roots(HashTable<Cell*>& roots) roots.set(&argument.as_cell()); } roots.set(execution_context->lexical_environment); + roots.set(execution_context->variable_environment); } #define __JS_ENUMERATE(SymbolName, snake_name) \ |