diff --git a/Libraries/LibJS/Heap/Heap.cpp b/Libraries/LibJS/Heap/Heap.cpp index 8055311184e..ed583bce2f2 100644 --- a/Libraries/LibJS/Heap/Heap.cpp +++ b/Libraries/LibJS/Heap/Heap.cpp @@ -317,9 +317,8 @@ NO_SANITIZE_ADDRESS void Heap::gather_conservative_roots(HashMap(&dummy); - auto& stack_info = m_vm.stack_info(); - for (FlatPtr stack_address = stack_reference; stack_address < stack_info.top(); stack_address += sizeof(FlatPtr)) { + for (FlatPtr stack_address = stack_reference; stack_address < m_stack_info.top(); stack_address += sizeof(FlatPtr)) { auto data = *reinterpret_cast(stack_address); add_possible_value(possible_pointers, data, HeapRoot { .type = HeapRoot::Type::StackPointer }, min_block_address, max_block_address); gather_asan_fake_stack_roots(possible_pointers, data, min_block_address, max_block_address); diff --git a/Libraries/LibJS/Heap/Heap.h b/Libraries/LibJS/Heap/Heap.h index 21f7873e3d6..ac1f08520fb 100644 --- a/Libraries/LibJS/Heap/Heap.h +++ b/Libraries/LibJS/Heap/Heap.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -155,6 +156,7 @@ private: bool m_should_gc_when_deferral_ends { false }; bool m_collecting_garbage { false }; + StackInfo m_stack_info; }; inline void Heap::did_create_handle(Badge, HandleImpl& impl)