[compiler-rt] [compiler-rt] [Darwin] VerifyMemoryMapping should ignore zero-size sections (PR #175083)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 8 14:47:23 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Andrew Haberlandt (ndrewh)

<details>
<summary>Changes</summary>

Zero size sections cause VerifyMemoryMapping to falsely report overlapping mappings.

rdar://167467041

---
Full diff: https://github.com/llvm/llvm-project/pull/175083.diff


1 Files Affected:

- (modified) compiler-rt/lib/sanitizer_common/sanitizer_procmaps_mac.cpp (+2) 


``````````diff
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_mac.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_mac.cpp
index f40fba6bf7151..979729f15aa16 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_mac.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_mac.cpp
@@ -67,6 +67,8 @@ static bool VerifyMemoryMapping(MemoryMappingLayout* mapping) {
   InternalMmapVector<LoadedModule::AddressRange> segments;
   for (uptr i = 0; i < modules.size(); ++i) {
     for (auto& range : modules[i].ranges()) {
+      if (range.beg == range.end)
+        continue;
       segments.push_back(range);
     }
   }

``````````

</details>


https://github.com/llvm/llvm-project/pull/175083


More information about the llvm-commits mailing list