[compiler-rt] b83289b - [NFC][asan] Replace a few `#if SANITIZER_APPLE` with `if (SANITIZER_APPLE` (#74173)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 4 14:57:11 PST 2023
Author: Vitaly Buka
Date: 2023-12-04T14:57:08-08:00
New Revision: b83289b0b66c8e88a8ab5c53d91327a380cfb0bd
URL: https://github.com/llvm/llvm-project/commit/b83289b0b66c8e88a8ab5c53d91327a380cfb0bd
DIFF: https://github.com/llvm/llvm-project/commit/b83289b0b66c8e88a8ab5c53d91327a380cfb0bd.diff
LOG: [NFC][asan] Replace a few `#if SANITIZER_APPLE` with `if (SANITIZER_APPLE` (#74173)
Added:
Modified:
compiler-rt/lib/asan/asan_interceptors.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/asan/asan_interceptors.cpp b/compiler-rt/lib/asan/asan_interceptors.cpp
index 7f2aecae2e3a5..1a1a26a7cd8bf 100644
--- a/compiler-rt/lib/asan/asan_interceptors.cpp
+++ b/compiler-rt/lib/asan/asan_interceptors.cpp
@@ -635,10 +635,8 @@ INTERCEPTOR_STRTO_BASE(long long, __isoc23_strtoll)
INTERCEPTOR(int, atoi, const char *nptr) {
void *ctx;
ASAN_INTERCEPTOR_ENTER(ctx, atoi);
-#if SANITIZER_APPLE
- if (UNLIKELY(!AsanInited()))
+ if (SANITIZER_APPLE && UNLIKELY(!AsanInited()))
return REAL(atoi)(nptr);
-# endif
ENSURE_ASAN_INITED();
if (!flags()->replace_str) {
return REAL(atoi)(nptr);
@@ -657,10 +655,8 @@ INTERCEPTOR(int, atoi, const char *nptr) {
INTERCEPTOR(long, atol, const char *nptr) {
void *ctx;
ASAN_INTERCEPTOR_ENTER(ctx, atol);
-#if SANITIZER_APPLE
- if (UNLIKELY(!AsanInited()))
+ if (SANITIZER_APPLE && UNLIKELY(!AsanInited()))
return REAL(atol)(nptr);
-# endif
ENSURE_ASAN_INITED();
if (!flags()->replace_str) {
return REAL(atol)(nptr);
@@ -696,10 +692,8 @@ static void AtCxaAtexit(void *unused) {
#if ASAN_INTERCEPT___CXA_ATEXIT
INTERCEPTOR(int, __cxa_atexit, void (*func)(void *), void *arg,
void *dso_handle) {
-#if SANITIZER_APPLE
- if (UNLIKELY(!AsanInited()))
+ if (SANITIZER_APPLE && UNLIKELY(!AsanInited()))
return REAL(__cxa_atexit)(func, arg, dso_handle);
-# endif
ENSURE_ASAN_INITED();
#if CAN_SANITIZE_LEAKS
__lsan::ScopedInterceptorDisabler disabler;
More information about the llvm-commits
mailing list