From e240084437ea0bfe03d83dc3533d4ee6214b7206 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 11 Nov 2024 15:45:51 +0100 Subject: [PATCH] LibJS: Use correct cell address for HeapFunction captures in GC dumps We were previously dumping the address of the cell pointer instead of the address of the cell itself. This was causing mysterious orphans in GC dumps, and it took me way too long to figure this out. --- Libraries/LibJS/Heap/Heap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibJS/Heap/Heap.cpp b/Libraries/LibJS/Heap/Heap.cpp index 686f1ad3691..0f727486f57 100644 --- a/Libraries/LibJS/Heap/Heap.cpp +++ b/Libraries/LibJS/Heap/Heap.cpp @@ -152,7 +152,7 @@ public: for_each_cell_among_possible_pointers(m_all_live_heap_blocks, possible_pointers, [&](Cell* cell, FlatPtr) { if (m_node_being_visited) - m_node_being_visited->edges.set(reinterpret_cast(&cell)); + m_node_being_visited->edges.set(reinterpret_cast(cell)); if (m_graph.get(reinterpret_cast(&cell)).has_value()) return;