summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2023-12-01 19:20:23 -0800
committerVitaly Buka <vitalybuka@google.com>2023-12-01 19:20:23 -0800
commitc630b3d042729fa2053866c959e8e05b8ce11267 (patch)
tree1fb4f390514c1e6be7603f46b4ee9b8adc83b556
parent28eead018d80a5384b8be6f259c3d2e2b849e8cf (diff)
Created using spr 1.3.4 [skip ci]
-rw-r--r--compiler-rt/lib/asan/asan_interceptors.h9
-rw-r--r--compiler-rt/lib/asan/asan_rtl.cpp4
2 files changed, 6 insertions, 7 deletions
diff --git a/compiler-rt/lib/asan/asan_interceptors.h b/compiler-rt/lib/asan/asan_interceptors.h
index e355c1258a9f..6a7748c8f9bb 100644
--- a/compiler-rt/lib/asan/asan_interceptors.h
+++ b/compiler-rt/lib/asan/asan_interceptors.h
@@ -24,12 +24,9 @@ namespace __asan {
void InitializeAsanInterceptors();
void InitializePlatformInterceptors();
-#define ENSURE_ASAN_INITED() \
- do { \
- CHECK(!AsanInitIsRunning()); \
- if (UNLIKELY(!AsanInited())) { \
- AsanInitFromRtl(); \
- } \
+#define ENSURE_ASAN_INITED() \
+ do { \
+ AsanInitFromRtl(); \
} while (0)
} // namespace __asan
diff --git a/compiler-rt/lib/asan/asan_rtl.cpp b/compiler-rt/lib/asan/asan_rtl.cpp
index d8bd19d8b79d..b129e22813da 100644
--- a/compiler-rt/lib/asan/asan_rtl.cpp
+++ b/compiler-rt/lib/asan/asan_rtl.cpp
@@ -520,7 +520,9 @@ static void AsanInitInternal() {
// Initialize as requested from some part of ASan runtime library (interceptors,
// allocator, etc).
void AsanInitFromRtl() {
- AsanInitInternal();
+ CHECK(!AsanInitIsRunning());
+ if (UNLIKELY(!AsanInited()))
+ AsanInitInternal();
}
#if ASAN_DYNAMIC