[compiler-rt] [TySan] Intercept malloc_size on Apple platforms. (PR #122133)

Mingjie Xu via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 8 18:13:00 PST 2025


================
@@ -110,7 +110,7 @@ INTERCEPTOR(void *, malloc, uptr size) {
 
 #if SANITIZER_APPLE
 INTERCEPTOR(uptr, malloc_size, void *ptr) {
-  if (DlsymAlloc::Use())
+  if (DlsymAlloc::Use() || DlsymAlloc::PointerIsMine(ptr))
----------------
Enna1 wrote:

For `realloc`, during TySan init `realloc(0, size)` can make `DlSymAlloc::Use` is true but `DlsymAlloc::PointerIsMine(ptr)` is false.

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


More information about the llvm-commits mailing list