[PATCH] D46459: [asan] On RTEMS, checks for asan_inited before entering ASan run-time

Walter Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 7 20:21:55 PDT 2018


waltl updated this revision to Diff 145628.
waltl added a comment.

Rely on early init of shadow memory, so now we can remove most checks.
2 are left.


Repository:
  rL LLVM

https://reviews.llvm.org/D46459

Files:
  compiler-rt/lib/asan/asan_fake_stack.cc
  compiler-rt/lib/asan/asan_rtl.cc


Index: compiler-rt/lib/asan/asan_rtl.cc
===================================================================
--- compiler-rt/lib/asan/asan_rtl.cc
+++ compiler-rt/lib/asan/asan_rtl.cc
@@ -524,6 +524,9 @@
 using namespace __asan;  // NOLINT
 
 void NOINLINE __asan_handle_no_return() {
+  if (SANITIZER_RTEMS && !asan_inited)
+    return;
+
   if (asan_init_is_running)
     return;
 
Index: compiler-rt/lib/asan/asan_fake_stack.cc
===================================================================
--- compiler-rt/lib/asan/asan_fake_stack.cc
+++ compiler-rt/lib/asan/asan_fake_stack.cc
@@ -192,6 +192,8 @@
 }
 
 static FakeStack *GetFakeStackFast() {
+  if (SANITIZER_RTEMS && !asan_inited)
+    return nullptr;
   if (FakeStack *fs = GetTLSFakeStack())
     return fs;
   if (!__asan_option_detect_stack_use_after_return)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46459.145628.patch
Type: text/x-patch
Size: 822 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180508/79b0b181/attachment.bin>


More information about the llvm-commits mailing list