From d0e7ffdf37ac042b7eb4875223df826153aeff13 Mon Sep 17 00:00:00 2001 From: Zaggy1024 Date: Mon, 2 Mar 2026 16:26:29 -0600 Subject: [PATCH] LibGC: Add missing root type switch cases in graph dump Also, remove the default case so that we don't end up with missing cases again. --- Libraries/LibGC/Heap.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Libraries/LibGC/Heap.cpp b/Libraries/LibGC/Heap.cpp index 13d1e24ad4..c03bf9bc36 100644 --- a/Libraries/LibGC/Heap.cpp +++ b/Libraries/LibGC/Heap.cpp @@ -208,11 +208,14 @@ public: auto node = AK::JsonObject(); if (it.value.root_origin.has_value()) { auto type = it.value.root_origin->type; - auto location = it.value.root_origin->location; + auto const* location = it.value.root_origin->location; switch (type) { case HeapRoot::Type::ConservativeVector: node.set("root"sv, "ConservativeVector"sv); break; + case HeapRoot::Type::HeapFunctionCapturedPointer: + node.set("root"sv, "HeapFunctionCapturedPointer"sv); + break; case HeapRoot::Type::MustSurviveGC: node.set("root"sv, "MustSurviveGC"sv); break; @@ -222,6 +225,9 @@ public: case HeapRoot::Type::RootVector: node.set("root"sv, "RootVector"sv); break; + case HeapRoot::Type::RootHashMap: + node.set("root"sv, "RootHashMap"sv); + break; case HeapRoot::Type::RegisterPointer: node.set("root"sv, "RegisterPointer"sv); if (it.value.root_origin->stack_frame_index.has_value()) @@ -235,9 +241,8 @@ public: case HeapRoot::Type::VM: node.set("root"sv, "VM"sv); break; - default: - VERIFY_NOT_REACHED(); } + VERIFY(node.has("root"sv)); } node.set("class_name"sv, it.value.class_name); node.set("edges"sv, edges);