[compiler-rt] [scudo] Die when store is called on MapAllocatorNoCache objects. (PR #102403)

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 16:32:45 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

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

Author: Christopher Ferris (cferris1000)

<details>
<summary>Changes</summary>



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


1 Files Affected:

- (modified) compiler-rt/lib/scudo/standalone/secondary.h (+5-2) 


``````````diff
diff --git a/compiler-rt/lib/scudo/standalone/secondary.h b/compiler-rt/lib/scudo/standalone/secondary.h
index 51721fab52ced..34b16df75841b 100644
--- a/compiler-rt/lib/scudo/standalone/secondary.h
+++ b/compiler-rt/lib/scudo/standalone/secondary.h
@@ -95,8 +95,11 @@ template <typename Config> class MapAllocatorNoCache {
     return {};
   }
   void store(UNUSED Options Options, UNUSED uptr CommitBase,
-             UNUSED uptr CommitSize, UNUSED uptr BlockBegin, MemMapT MemMap) {
-    unmap(MemMap);
+             UNUSED uptr CommitSize, UNUSED uptr BlockBegin,
+             UNUSED MemMapT MemMap) {
+    // This should never be called since canCache always returns false.
+    UNREACHABLE(
+        "It is not valid to call store on MapAllocatorNoCache objects.");
   }
 
   bool canCache(UNUSED uptr Size) { return false; }

``````````

</details>


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


More information about the llvm-commits mailing list