diff options
author | Vitaly Buka <vitalybuka@google.com> | 2023-12-04 10:59:11 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-04 10:59:11 -0800 |
commit | e893f69545148c723a8b51d0975eb0142de86c62 (patch) | |
tree | a2681131a706e0ddc29b1f097941097f2f00439c | |
parent | cae650ef3764288e1df47dcc48a5e180d1289ff4 (diff) | |
download | llvm-e893f69545148c723a8b51d0975eb0142de86c62.zip llvm-e893f69545148c723a8b51d0975eb0142de86c62.tar.gz llvm-e893f69545148c723a8b51d0975eb0142de86c62.tar.bz2 |
[NFC][ASAN] Move ENSURE_ASAN_INITED into AsanInitFromRtl (#74170)
-rw-r--r-- | compiler-rt/lib/asan/asan_interceptors.h | 9 | ||||
-rw-r--r-- | 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 |