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

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 18:50:27 PDT 2024


Author: Christopher Ferris
Date: 2024-08-07T18:50:22-07:00
New Revision: a753c9921e66eee360a6ce7ee70305b941595829

URL: https://github.com/llvm/llvm-project/commit/a753c9921e66eee360a6ce7ee70305b941595829
DIFF: https://github.com/llvm/llvm-project/commit/a753c9921e66eee360a6ce7ee70305b941595829.diff

LOG: [scudo] Die when store is called on MapAllocatorNoCache objects. (#102403)

Added: 
    

Modified: 
    compiler-rt/lib/scudo/standalone/secondary.h

Removed: 
    


################################################################################
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; }


        


More information about the llvm-commits mailing list