[compiler-rt] [sanitizer_common] Split FREXPF/FREXPL interceptor defines (PR #138624)
via llvm-commits
llvm-commits at lists.llvm.org
Mon May 5 21:28:10 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-compiler-rt-sanitizer
Author: Jake Egan (jakeegan)
<details>
<summary>Changes</summary>
Will allow other platforms, such as AIX, to opt out of these interceptors individually.
---
Full diff: https://github.com/llvm/llvm-project/pull/138624.diff
2 Files Affected:
- (modified) compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc (+12-7)
- (modified) compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h (+2-1)
``````````diff
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
index 5a15d75f0c86a..26c448152cfc1 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
@@ -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);
@@ -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);
@@ -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,
@@ -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;
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
index b8f2f738e7478..4bc55d7801db7 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
@@ -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 \
``````````
</details>
https://github.com/llvm/llvm-project/pull/138624
More information about the llvm-commits
mailing list