Skip to content

Commit e893f69

Browse files
authored
[NFC][ASAN] Move ENSURE_ASAN_INITED into AsanInitFromRtl (llvm#74170)
1 parent cae650e commit e893f69

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

compiler-rt/lib/asan/asan_interceptors.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,9 @@ namespace __asan {
2424
void InitializeAsanInterceptors();
2525
void InitializePlatformInterceptors();
2626

27-
#define ENSURE_ASAN_INITED() \
28-
do { \
29-
CHECK(!AsanInitIsRunning()); \
30-
if (UNLIKELY(!AsanInited())) { \
31-
AsanInitFromRtl(); \
32-
} \
27+
#define ENSURE_ASAN_INITED() \
28+
do { \
29+
AsanInitFromRtl(); \
3330
} while (0)
3431

3532
} // namespace __asan

compiler-rt/lib/asan/asan_rtl.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,9 @@ static void AsanInitInternal() {
520520
// Initialize as requested from some part of ASan runtime library (interceptors,
521521
// allocator, etc).
522522
void AsanInitFromRtl() {
523-
AsanInitInternal();
523+
CHECK(!AsanInitIsRunning());
524+
if (UNLIKELY(!AsanInited()))
525+
AsanInitInternal();
524526
}
525527

526528
#if ASAN_DYNAMIC

0 commit comments

Comments
 (0)