From e893f69545148c723a8b51d0975eb0142de86c62 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Mon, 4 Dec 2023 10:59:11 -0800 Subject: [NFC][ASAN] Move ENSURE_ASAN_INITED into AsanInitFromRtl (#74170) --- compiler-rt/lib/asan/asan_interceptors.h | 9 +++------ compiler-rt/lib/asan/asan_rtl.cpp | 4 +++- 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 e355c12..6a7748c 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 d8bd19d..b129e22 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 -- cgit v1.1