[PATCH] D46459: [asan] Make GetCurrentThread RTEMS-friendly

Aleksey Shlyapnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 18 10:31:18 PDT 2018


alekseyshl added inline comments.


================
Comment at: compiler-rt/lib/asan/asan_thread.cc:394
+    return nullptr;
+
   AsanThreadContext *context =
----------------
vitalybuka wrote:
> What if you just put here and we avoid platform specific branch
> ```
> if (UNLIKELY(!asan_inited))
>   AsanInitFromRtl();
> ```
> 
> !asan_inited is not expected here on any other platform
But it still be a check, still some code executed, even if it is unlikely. With SANITIZER_RTEMS, it will be removed on all platforms, but RTEMS.

The semantics is also wrong, this way it creates an impression that it can happen on all platforms.


Repository:
  rL LLVM

https://reviews.llvm.org/D46459





More information about the llvm-commits mailing list