[compiler-rt] [sanitizer_common][asan] Implement address sanitizer on AIX: interceptors (5/6) (PR #131870)

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Thu May 1 01:04:05 PDT 2025


================
@@ -1807,17 +1816,29 @@ FORMAT_INTERCEPTOR_IMPL(__isoc99_snprintf, __isoc99_vsnprintf, str, size,
 #endif  // SANITIZER_INTERCEPT_PRINTF
 
 #if SANITIZER_INTERCEPT_PRINTF
----------------
vitalybuka wrote:

Maybe something like:
```
#if SANITIZER_INTERCEPT_PRINTF
#    define INIT_PRINTF_COMMON                          \
      COMMON_INTERCEPT_FUNCTION_LDBL(printf);    \
      COMMON_INTERCEPT_FUNCTION_LDBL(sprintf);   \
      COMMON_INTERCEPT_FUNCTION_LDBL(snprintf);  \
      COMMON_INTERCEPT_FUNCTION_LDBL(fprintf);   \
      COMMON_INTERCEPT_FUNCTION_LDBL(vprintf);   \
      COMMON_INTERCEPT_FUNCTION_LDBL(vsprintf);  \
      COMMON_INTERCEPT_FUNCTION_LDBL(vsnprintf); \
      COMMON_INTERCEPT_FUNCTION_LDBL(vfprintf);
#  if !SANITIZER_AIX
#    define INIT_PRINTF_EXTRA                          \
      COMMON_INTERCEPT_FUNCTION_LDBL(asprintf);  \
      COMMON_INTERCEPT_FUNCTION_LDBL(vasprintf); \
#else
   #define INIT_PRINTF_EXTRA                          
#endif
#    define INIT_PRINTF  INIT_PRINTF_COMMON INIT_PRINTF_EXTRA
#  endif
#else
#define INIT_PRINTF
#endif
```

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


More information about the llvm-commits mailing list