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

Florian Mayer via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 8 08:56:03 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))
----------------
fmayer wrote:

Same question as for `realloc`: please document the state transitions we support.

Specifically: could it be that `DlSymAlloc::Use` is true but _NOT_ `DlsymAlloc::PointerIsMine(ptr)` (e.g. because the pointer was created before DlSymAlloc was enabled? That would be incorrect then I think.

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


More information about the llvm-commits mailing list