From e69a06b358cbdbd62229f5f5f749d3729ea0d84b Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 21 May 2023 13:13:53 +0200 Subject: [PATCH] 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. --- Userland/Libraries/LibJS/Runtime/VM.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Runtime/VM.cpp b/Userland/Libraries/LibJS/Runtime/VM.cpp index 8c328cab8d..7a7d244405 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.cpp +++ b/Userland/Libraries/LibJS/Runtime/VM.cpp @@ -252,7 +252,7 @@ void VM::gather_roots(HashTable& roots) gather_roots_from_execution_context_stack(saved_stack); #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 #undef __JS_ENUMERATE