Skip to content

Commit e696365

Browse files
jakeeganGeorgeARM
authored andcommitted
[sanitizer_common] Split FREXPF/FREXPL interceptor defines (llvm#138624)
Will allow other platforms, such as AIX, to opt out of these interceptors individually.
1 parent e2ad426 commit e696365

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ INTERCEPTOR(double, frexp, double x, int *exp) {
953953
#define INIT_FREXP
954954
#endif // SANITIZER_INTERCEPT_FREXP
955955

956-
#if SANITIZER_INTERCEPT_FREXPF_FREXPL
956+
#if SANITIZER_INTERCEPT_FREXPF
957957
INTERCEPTOR(float, frexpf, float x, int *exp) {
958958
void *ctx;
959959
COMMON_INTERCEPTOR_ENTER(ctx, frexpf, x, exp);
@@ -963,6 +963,12 @@ INTERCEPTOR(float, frexpf, float x, int *exp) {
963963
return res;
964964
}
965965

966+
# define INIT_FREXPF COMMON_INTERCEPT_FUNCTION(frexpf);
967+
#else
968+
# define INIT_FREXPF
969+
#endif
970+
971+
#if SANITIZER_INTERCEPT_FREXPL
966972
INTERCEPTOR(long double, frexpl, long double x, int *exp) {
967973
void *ctx;
968974
COMMON_INTERCEPTOR_ENTER(ctx, frexpl, x, exp);
@@ -972,12 +978,10 @@ INTERCEPTOR(long double, frexpl, long double x, int *exp) {
972978
return res;
973979
}
974980

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)
978982
#else
979-
#define INIT_FREXPF_FREXPL
980-
#endif // SANITIZER_INTERCEPT_FREXPF_FREXPL
983+
# define INIT_FREXPL
984+
#endif
981985

982986
#if SI_POSIX
983987
static void write_iovec(void *ctx, struct __sanitizer_iovec *iovec,
@@ -10411,7 +10415,8 @@ static void InitializeCommonInterceptors() {
1041110415
INIT_ISOC99_PRINTF;
1041210416
INIT_SETPROCTITLE;
1041310417
INIT_FREXP;
10414-
INIT_FREXPF_FREXPL;
10418+
INIT_FREXPF;
10419+
INIT_FREXPL;
1041510420
INIT_GETPWNAM_AND_FRIENDS;
1041610421
INIT_GETPWNAM_R_AND_FRIENDS;
1041710422
INIT_GETPWENT;

compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,8 @@ SANITIZER_WEAK_IMPORT void *aligned_alloc(__sanitizer::usize __alignment,
244244
(SANITIZER_INTERCEPT_PRINTF && SI_GLIBC)
245245

246246
#define SANITIZER_INTERCEPT_FREXP SI_NOT_FUCHSIA
247-
#define SANITIZER_INTERCEPT_FREXPF_FREXPL SI_POSIX
247+
#define SANITIZER_INTERCEPT_FREXPF SI_POSIX
248+
#define SANITIZER_INTERCEPT_FREXPL SI_POSIX
248249

249250
#define SANITIZER_INTERCEPT_GETPWNAM_AND_FRIENDS SI_POSIX
250251
#define SANITIZER_INTERCEPT_GETPWNAM_R_AND_FRIENDS \

0 commit comments

Comments
 (0)