Browse Source

LibJS: Interpreter should make sure that the "this" stack gets marked

Andreas Kling 5 years ago
parent
commit
fbefb19e10
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Libraries/LibJS/Interpreter.cpp

+ 5 - 0
Libraries/LibJS/Interpreter.cpp

@@ -144,6 +144,11 @@ void Interpreter::collect_roots(Badge<Heap>, HashTable<Cell*>& roots)
                 roots.set(it.value.value.as_cell());
         }
     }
+
+    for (auto& this_value : m_this_stack) {
+        if (this_value.is_cell())
+            roots.set(this_value.as_cell());
+    }
 }
 
 }