From d38c8a21b7a7c1c7cf5a50c49bcf7ec8c3a7eb94 Mon Sep 17 00:00:00 2001 From: Max Charlamb Date: Wed, 25 Feb 2026 11:17:45 -0500 Subject: [PATCH] Fix inverted IsNull check in RangeSectionMap::EnumMemoryRangeSectionMapLevel The template overload of EnumMemoryRangeSectionMapLevel (handling levels L2-L5 on 64-bit) had an inverted condition: it called IsNull() without negation, causing it to skip all populated entries and attempt to dereference null pointers. The non-template L1 overload at line 1538 correctly uses !IsNull(). This bug meant EnumMemoryRegions for the RangeSectionMap never actually enumerated anything below the top level on 64-bit, potentially causing incomplete dumps where RangeSection data is missing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/coreclr/vm/codeman.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/vm/codeman.h b/src/coreclr/vm/codeman.h index 1f13e6e71c0f92..650d9ad351e440 100644 --- a/src/coreclr/vm/codeman.h +++ b/src/coreclr/vm/codeman.h @@ -1550,7 +1550,7 @@ class RangeSectionMap for (uintptr_t i = 0; i < entriesPerMapLevel; i++) { - if (level[i].IsNull()) + if (!level[i].IsNull()) { EnumMemoryRangeSectionMapLevel(flags, *level[i].VolatileLoad(pLockState), pLockState); }