]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
malloc: Extend malloc function hiding to tst-reallocarray (BZ #32366)
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 5 Dec 2025 19:11:36 +0000 (16:11 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 9 Dec 2025 14:14:14 +0000 (11:14 -0300)
clang 20 optimize out reallocarray.

Reviewed-by: Sam James <sam@gentoo.org>
malloc/tst-malloc-aux.h
malloc/tst-reallocarray.c

index cd752afa8ba1c7810a3071f5887fa701c398a1d7..8bed28583a09aca913b48bd0ec8e1b7f13cbff96 100644 (file)
@@ -34,6 +34,7 @@ static __typeof (posix_memalign) * volatile posix_memalign_indirect
 static __typeof (pvalloc) * volatile pvalloc_indirect = pvalloc;
 static __typeof (realloc) * volatile realloc_indirect = realloc;
 static __typeof (valloc) * volatile valloc_indirect = valloc;
+static __typeof (reallocarray) * volatile reallocarray_indirect = reallocarray;
 
 #undef aligned_alloc
 #undef calloc
@@ -43,6 +44,7 @@ static __typeof (valloc) * volatile valloc_indirect = valloc;
 #undef pvalloc
 #undef realloc
 #undef valloc
+#undef reallocarray
 
 #define aligned_alloc aligned_alloc_indirect
 #define calloc calloc_indirect
@@ -52,5 +54,6 @@ static __typeof (valloc) * volatile valloc_indirect = valloc;
 #define pvalloc pvalloc_indirect
 #define realloc realloc_indirect
 #define valloc valloc_indirect
+#define reallocarray reallocarray_indirect
 
 #endif /* TST_MALLOC_AUX_H */
index b4df4aa4e6dfde3f3c0b45156238e04ed28ec1c1..b00a508f50e42c9bba2714aee7b5cedbaf5084b1 100644 (file)
@@ -21,6 +21,7 @@
 #include <string.h>
 #include <support/check.h>
 #include <libc-diag.h>
+#include "tst-malloc-aux.h"
 
 static void *
 reallocarray_nowarn (void *ptr, size_t nmemb, size_t size)