From: Adhemerval Zanella Date: Fri, 5 Dec 2025 19:11:36 +0000 (-0300) Subject: malloc: Extend malloc function hiding to tst-reallocarray (BZ #32366) X-Git-Tag: glibc-2.43~108 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d89e3a77c496916505bd112f0802dee0420af953;p=thirdparty%2Fglibc.git malloc: Extend malloc function hiding to tst-reallocarray (BZ #32366) clang 20 optimize out reallocarray. Reviewed-by: Sam James --- diff --git a/malloc/tst-malloc-aux.h b/malloc/tst-malloc-aux.h index cd752afa8b..8bed28583a 100644 --- a/malloc/tst-malloc-aux.h +++ b/malloc/tst-malloc-aux.h @@ -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 */ diff --git a/malloc/tst-reallocarray.c b/malloc/tst-reallocarray.c index b4df4aa4e6..b00a508f50 100644 --- a/malloc/tst-reallocarray.c +++ b/malloc/tst-reallocarray.c @@ -21,6 +21,7 @@ #include #include #include +#include "tst-malloc-aux.h" static void * reallocarray_nowarn (void *ptr, size_t nmemb, size_t size)