@@ -480,7 +480,7 @@ INTERCEPTOR(char*, textdomain, const char *domainname) {
480
480
#define INIT_TEXTDOMAIN
481
481
#endif
482
482
483
- #if SANITIZER_INTERCEPT_STRCMP || SANITIZER_INTERCEPT_MEMCMP
483
+ #if SANITIZER_INTERCEPT_MEMCMP
484
484
static inline int CharCmpX (unsigned char c1, unsigned char c2) {
485
485
return (c1 == c2) ? 0 : (c1 < c2) ? -1 : 1 ;
486
486
}
@@ -953,7 +953,7 @@ INTERCEPTOR(double, frexp, double x, int *exp) {
953
953
#define INIT_FREXP
954
954
#endif // SANITIZER_INTERCEPT_FREXP
955
955
956
- #if SANITIZER_INTERCEPT_FREXPF_FREXPL
956
+ #if SANITIZER_INTERCEPT_FREXPF
957
957
INTERCEPTOR (float , frexpf, float x, int *exp) {
958
958
void *ctx;
959
959
COMMON_INTERCEPTOR_ENTER (ctx, frexpf, x, exp);
@@ -963,6 +963,12 @@ INTERCEPTOR(float, frexpf, float x, int *exp) {
963
963
return res;
964
964
}
965
965
966
+ #define INIT_FREXPF COMMON_INTERCEPT_FUNCTION (frexpf);
967
+ #else
968
+ #define INIT_FREXPF
969
+ #endif
970
+
971
+ #if SANITIZER_INTERCEPT_FREXPL
966
972
INTERCEPTOR (long double , frexpl, long double x, int *exp) {
967
973
void *ctx;
968
974
COMMON_INTERCEPTOR_ENTER (ctx, frexpl, x, exp);
@@ -972,12 +978,10 @@ INTERCEPTOR(long double, frexpl, long double x, int *exp) {
972
978
return res;
973
979
}
974
980
975
- #define INIT_FREXPF_FREXPL \
976
- COMMON_INTERCEPT_FUNCTION (frexpf); \
977
- COMMON_INTERCEPT_FUNCTION_LDBL (frexpl)
981
+ #define INIT_FREXPL COMMON_INTERCEPT_FUNCTION_LDBL (frexpl)
978
982
#else
979
- #define INIT_FREXPF_FREXPL
980
- #endif // SANITIZER_INTERCEPT_FREXPF_FREXPL
983
+ #define INIT_FREXPL
984
+ #endif
981
985
982
986
#if SI_POSIX
983
987
static void write_iovec (void *ctx, struct __sanitizer_iovec *iovec,
@@ -1346,7 +1350,8 @@ INTERCEPTOR(unsigned long, time, unsigned long *t) {
1346
1350
#if SANITIZER_INTERCEPT_LOCALTIME_AND_FRIENDS
1347
1351
static void unpoison_tm (void *ctx, __sanitizer_tm *tm) {
1348
1352
COMMON_INTERCEPTOR_WRITE_RANGE (ctx, tm, sizeof (*tm));
1349
- #if !SANITIZER_SOLARIS
1353
+ // AIX tm struct does not have tm_zone field.
1354
+ #if !SANITIZER_SOLARIS && !SANITIZER_AIX
1350
1355
if (tm->tm_zone ) {
1351
1356
// Can not use COMMON_INTERCEPTOR_WRITE_RANGE here, because tm->tm_zone
1352
1357
// can point to shared memory and tsan would report a data race.
@@ -1731,8 +1736,10 @@ INTERCEPTOR(int, __vsprintf_chk, char *str, int flag, SIZE_T size_to,
1731
1736
VSPRINTF_INTERCEPTOR_IMPL (vsprintf, str, format, ap)
1732
1737
#endif
1733
1738
1739
+ #if SANITIZER_INTERCEPT_VASPRINTF
1734
1740
INTERCEPTOR (int , vasprintf, char **strp, const char *format, va_list ap)
1735
1741
VASPRINTF_INTERCEPTOR_IMPL (vasprintf, strp, format, ap)
1742
+ #endif
1736
1743
1737
1744
#if SANITIZER_INTERCEPT_ISOC99_PRINTF
1738
1745
INTERCEPTOR (int , __isoc99_vprintf, const char *format, va_list ap)
@@ -1783,8 +1790,10 @@ INTERCEPTOR(int, __snprintf_chk, char *str, SIZE_T size, int flag,
1783
1790
FORMAT_INTERCEPTOR_IMPL (__snprintf_chk, vsnprintf, str, size, format)
1784
1791
#endif
1785
1792
1793
+ #if SANITIZER_INTERCEPT_ASPRINTF
1786
1794
INTERCEPTOR (int , asprintf, char **strp, const char *format, ...)
1787
1795
FORMAT_INTERCEPTOR_IMPL (asprintf, vasprintf, strp, format)
1796
+ #endif
1788
1797
1789
1798
#if SANITIZER_INTERCEPT_ISOC99_PRINTF
1790
1799
INTERCEPTOR (int , __isoc99_printf, const char *format, ...)
@@ -1807,17 +1816,29 @@ FORMAT_INTERCEPTOR_IMPL(__isoc99_snprintf, __isoc99_vsnprintf, str, size,
1807
1816
#endif // SANITIZER_INTERCEPT_PRINTF
1808
1817
1809
1818
#if SANITIZER_INTERCEPT_PRINTF
1819
+ #if SANITIZER_AIX
1820
+ #define INIT_PRINTF \
1821
+ COMMON_INTERCEPT_FUNCTION_LDBL (printf); \
1822
+ COMMON_INTERCEPT_FUNCTION_LDBL (sprintf); \
1823
+ COMMON_INTERCEPT_FUNCTION_LDBL (snprintf); \
1824
+ COMMON_INTERCEPT_FUNCTION_LDBL (fprintf); \
1825
+ COMMON_INTERCEPT_FUNCTION_LDBL (vprintf); \
1826
+ COMMON_INTERCEPT_FUNCTION_LDBL (vsprintf); \
1827
+ COMMON_INTERCEPT_FUNCTION_LDBL (vsnprintf); \
1828
+ COMMON_INTERCEPT_FUNCTION_LDBL (vfprintf);
1829
+ #else
1810
1830
#define INIT_PRINTF \
1811
1831
COMMON_INTERCEPT_FUNCTION_LDBL (printf); \
1812
1832
COMMON_INTERCEPT_FUNCTION_LDBL (sprintf); \
1813
1833
COMMON_INTERCEPT_FUNCTION_LDBL (snprintf); \
1814
- COMMON_INTERCEPT_FUNCTION_LDBL (asprintf); \
1815
1834
COMMON_INTERCEPT_FUNCTION_LDBL (fprintf); \
1816
1835
COMMON_INTERCEPT_FUNCTION_LDBL (vprintf); \
1817
1836
COMMON_INTERCEPT_FUNCTION_LDBL (vsprintf); \
1818
1837
COMMON_INTERCEPT_FUNCTION_LDBL (vsnprintf); \
1838
+ COMMON_INTERCEPT_FUNCTION_LDBL (asprintf); \
1819
1839
COMMON_INTERCEPT_FUNCTION_LDBL (vasprintf); \
1820
1840
COMMON_INTERCEPT_FUNCTION_LDBL (vfprintf);
1841
+ #endif
1821
1842
#else
1822
1843
#define INIT_PRINTF
1823
1844
#endif
@@ -3901,7 +3922,10 @@ INTERCEPTOR(SIZE_T, wcrtomb, char *dest, wchar_t src, void *ps) {
3901
3922
if (res != ((SIZE_T)-1 )) {
3902
3923
CHECK_LE (res, sizeof (local_dest));
3903
3924
COMMON_INTERCEPTOR_WRITE_RANGE (ctx, dest, res);
3904
- REAL (memcpy)(dest, local_dest, res);
3925
+ if (!SANITIZER_AIX)
3926
+ REAL (memcpy)(dest, local_dest, res);
3927
+ else
3928
+ internal_memcpy (dest, local_dest, res);
3905
3929
}
3906
3930
return res;
3907
3931
}
@@ -3923,7 +3947,10 @@ INTERCEPTOR(int, wctomb, char *dest, wchar_t src) {
3923
3947
if (res != -1 ) {
3924
3948
CHECK_LE (res, sizeof (local_dest));
3925
3949
COMMON_INTERCEPTOR_WRITE_RANGE (ctx, dest, res);
3926
- REAL (memcpy)(dest, local_dest, res);
3950
+ if (!SANITIZER_AIX)
3951
+ REAL (memcpy)(dest, local_dest, res);
3952
+ else
3953
+ internal_memcpy (dest, local_dest, res);
3927
3954
}
3928
3955
return res;
3929
3956
}
@@ -10329,7 +10356,8 @@ static void InitializeCommonInterceptors() {
10329
10356
INIT_PRINTF_L;
10330
10357
INIT_ISOC99_PRINTF;
10331
10358
INIT_FREXP;
10332
- INIT_FREXPF_FREXPL;
10359
+ INIT_FREXPF;
10360
+ INIT_FREXPL;
10333
10361
INIT_GETPWNAM_AND_FRIENDS;
10334
10362
INIT_GETPWNAM_R_AND_FRIENDS;
10335
10363
INIT_GETPWENT;
0 commit comments