[PATCH] D104561: [NFC][compiler-rt][hwasan] Move hwasanThreadList().CreateCurrentThread() into InitThreads

Leonard Chan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 18 11:27:04 PDT 2021


leonardchan created this revision.
leonardchan added reviewers: phosek, mcgrathr, vitalybuka, eugenis.
leonardchan added a project: Sanitizers.
Herald added a subscriber: dberris.
leonardchan requested review of this revision.
Herald added a subscriber: Sanitizers.

Once D104553 <https://reviews.llvm.org/D104553> lands, `CreateCurrentThread` will be able to accept optional parameters for initializing the hwasan thread object. On fuchsia, we can get stack info in the platform-specific `InitThreads` and pass it through `CreateCurrentThread`. On linux, this is a no-op.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104561

Files:
  compiler-rt/lib/hwasan/hwasan.cpp
  compiler-rt/lib/hwasan/hwasan_linux.cpp


Index: compiler-rt/lib/hwasan/hwasan_linux.cpp
===================================================================
--- compiler-rt/lib/hwasan/hwasan_linux.cpp
+++ compiler-rt/lib/hwasan/hwasan_linux.cpp
@@ -250,6 +250,7 @@
   ProtectGap(thread_space_end,
              __hwasan_shadow_memory_dynamic_address - thread_space_end);
   InitThreadList(thread_space_start, thread_space_end - thread_space_start);
+  hwasanThreadList().CreateCurrentThread();
 }
 
 bool MemIsApp(uptr p) {
Index: compiler-rt/lib/hwasan/hwasan.cpp
===================================================================
--- compiler-rt/lib/hwasan/hwasan.cpp
+++ compiler-rt/lib/hwasan/hwasan.cpp
@@ -276,7 +276,6 @@
   }
 
   InitThreads();
-  hwasanThreadList().CreateCurrentThread();
 
   hwasan_instrumentation_inited = 1;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104561.353059.patch
Type: text/x-patch
Size: 800 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210618/28c382c8/attachment.bin>


More information about the cfe-commits mailing list