Browse Source

LibJS: Don't dereference well-known symbols when gathering roots

This fixes an issue where very early GC would crash trying to
dereference not-yet-initialized entries in the well-known symbol set.
Andreas Kling 2 years ago
parent
commit
e69a06b358
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Userland/Libraries/LibJS/Runtime/VM.cpp

+ 1 - 1
Userland/Libraries/LibJS/Runtime/VM.cpp

@@ -252,7 +252,7 @@ void VM::gather_roots(HashTable<Cell*>& roots)
         gather_roots_from_execution_context_stack(saved_stack);
         gather_roots_from_execution_context_stack(saved_stack);
 
 
 #define __JS_ENUMERATE(SymbolName, snake_name) \
 #define __JS_ENUMERATE(SymbolName, snake_name) \
-    roots.set(well_known_symbol_##snake_name());
+    roots.set(m_well_known_symbols.snake_name);
     JS_ENUMERATE_WELL_KNOWN_SYMBOLS
     JS_ENUMERATE_WELL_KNOWN_SYMBOLS
 #undef __JS_ENUMERATE
 #undef __JS_ENUMERATE