[llvm] uintptr_t to pointer cast: fix compilation error. (PR #101497)

Benoit Jacob via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 1 08:16:05 PDT 2024


https://github.com/bjacob created https://github.com/llvm/llvm-project/pull/101497

Compilation error introduced in #101312:

"no matching function for call to '__asan_unpoison_memory_region'"


>From 3e002a219a8b2ee98af62b9f3dd2770962ab6d57 Mon Sep 17 00:00:00 2001
From: Benoit Jacob <jacob.benoit.1 at gmail.com>
Date: Thu, 1 Aug 2024 11:13:35 -0400
Subject: [PATCH] uintptr_t to pointer cast: fix clang error: "no matching
 function for call to '__asan_unpoison_memory_region'"

Signed-off-by: Benoit Jacob <jacob.benoit.1 at gmail.com>
---
 llvm/include/llvm/Support/Allocator.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/llvm/include/llvm/Support/Allocator.h b/llvm/include/llvm/Support/Allocator.h
index 6be7c320a26f8..0cff44daebb71 100644
--- a/llvm/include/llvm/Support/Allocator.h
+++ b/llvm/include/llvm/Support/Allocator.h
@@ -171,7 +171,8 @@ class BumpPtrAllocatorImpl
       // will point to the allocation of the entire slab.
       __msan_allocated_memory(AlignedPtr, Size);
       // Similarly, tell ASan about this space.
-      __asan_unpoison_memory_region(AlignedPtr, Size);
+      __asan_unpoison_memory_region(reinterpret_cast<const void *>(AlignedPtr),
+                                    Size);
       return reinterpret_cast<char *>(AlignedPtr);
     }
 



More information about the llvm-commits mailing list