[compiler-rt] [asan] Switch initialization to "double-checked locking" (PR #74387)

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 5 00:40:39 PST 2023


================
@@ -408,9 +406,8 @@ static void AsanInitInternal() {
   // Stop performing init at this point if we are being loaded via
   // dlopen() and the platform supports it.
   if (SANITIZER_SUPPORTS_INIT_FOR_DLOPEN && UNLIKELY(HandleDlopenInit())) {
-    SetAsanInitIsRunning(0);
     VReport(1, "AddressSanitizer init is being performed for dlopen().\n");
-    return;
+    return false;
----------------
vitalybuka wrote:

I believe `__asan_handle_no_return` is unsupported before initialization, so 
```
if (UNLIKELY(!AsanInited()))
    return;
```
should be as good as the current state.

https://github.com/llvm/llvm-project/pull/74387


More information about the llvm-commits mailing list