mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibJS: Skip null entries in numeric string cache when gathering roots
This caused a crash when dumping the GC graph.
This commit is contained in:
parent
9ff75f442b
commit
ab00a4dc1f
Notes:
github-actions[bot]
2025-11-04 09:35:45 +00:00
Author: https://github.com/tcl3
Commit: ab00a4dc1f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6689
1 changed files with 5 additions and 1 deletions
|
|
@ -246,8 +246,12 @@ void VM::gather_roots(HashMap<GC::Cell*, GC::HeapRoot>& roots)
|
|||
for (auto string : m_single_ascii_character_strings)
|
||||
roots.set(string, GC::HeapRoot { .type = GC::HeapRoot::Type::VM });
|
||||
|
||||
for (auto string : m_numeric_string_cache)
|
||||
for (auto string : m_numeric_string_cache) {
|
||||
// The numeric string cache is populated lazily, so skip null entries.
|
||||
if (!string)
|
||||
continue;
|
||||
roots.set(string, GC::HeapRoot { .type = GC::HeapRoot::Type::VM });
|
||||
}
|
||||
|
||||
roots.set(cached_strings.number, GC::HeapRoot { .type = GC::HeapRoot::Type::VM });
|
||||
roots.set(cached_strings.undefined, GC::HeapRoot { .type = GC::HeapRoot::Type::VM });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue