Skip to content

[sanitizer_common] Split FREXPF/FREXPL interceptor defines #138624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ INTERCEPTOR(double, frexp, double x, int *exp) {
#define INIT_FREXP
#endif // SANITIZER_INTERCEPT_FREXP

#if SANITIZER_INTERCEPT_FREXPF_FREXPL
#if SANITIZER_INTERCEPT_FREXPF
INTERCEPTOR(float, frexpf, float x, int *exp) {
void *ctx;
COMMON_INTERCEPTOR_ENTER(ctx, frexpf, x, exp);
Expand All @@ -963,6 +963,12 @@ INTERCEPTOR(float, frexpf, float x, int *exp) {
return res;
}

# define INIT_FREXPF COMMON_INTERCEPT_FUNCTION(frexpf);
#else
# define INIT_FREXPF
#endif

#if SANITIZER_INTERCEPT_FREXPL
INTERCEPTOR(long double, frexpl, long double x, int *exp) {
void *ctx;
COMMON_INTERCEPTOR_ENTER(ctx, frexpl, x, exp);
Expand All @@ -972,12 +978,10 @@ INTERCEPTOR(long double, frexpl, long double x, int *exp) {
return res;
}

#define INIT_FREXPF_FREXPL \
COMMON_INTERCEPT_FUNCTION(frexpf); \
COMMON_INTERCEPT_FUNCTION_LDBL(frexpl)
# define INIT_FREXPL COMMON_INTERCEPT_FUNCTION_LDBL(frexpl)
#else
#define INIT_FREXPF_FREXPL
#endif // SANITIZER_INTERCEPT_FREXPF_FREXPL
# define INIT_FREXPL
#endif

#if SI_POSIX
static void write_iovec(void *ctx, struct __sanitizer_iovec *iovec,
Expand Down Expand Up @@ -10411,7 +10415,8 @@ static void InitializeCommonInterceptors() {
INIT_ISOC99_PRINTF;
INIT_SETPROCTITLE;
INIT_FREXP;
INIT_FREXPF_FREXPL;
INIT_FREXPF;
INIT_FREXPL;
INIT_GETPWNAM_AND_FRIENDS;
INIT_GETPWNAM_R_AND_FRIENDS;
INIT_GETPWENT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ SANITIZER_WEAK_IMPORT void *aligned_alloc(__sanitizer::usize __alignment,
(SANITIZER_INTERCEPT_PRINTF && SI_GLIBC)

#define SANITIZER_INTERCEPT_FREXP SI_NOT_FUCHSIA
#define SANITIZER_INTERCEPT_FREXPF_FREXPL SI_POSIX
#define SANITIZER_INTERCEPT_FREXPF SI_POSIX
#define SANITIZER_INTERCEPT_FREXPL SI_POSIX

#define SANITIZER_INTERCEPT_GETPWNAM_AND_FRIENDS SI_POSIX
#define SANITIZER_INTERCEPT_GETPWNAM_R_AND_FRIENDS \
Expand Down
Loading