From f7999e73caeff482a324ab0f9ac2fbeb99f8e3ec Mon Sep 17 00:00:00 2001 From: Leonard Chan Date: Fri, 18 Jun 2021 13:39:58 -0700 Subject: [PATCH] [NFC][compiler-rt][hwasan] Move hwasanThreadList().CreateCurrentThread() into InitThreads Once 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. Differential Revision: https://reviews.llvm.org/D104561 --- compiler-rt/lib/hwasan/hwasan.cpp | 1 - compiler-rt/lib/hwasan/hwasan_linux.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler-rt/lib/hwasan/hwasan.cpp b/compiler-rt/lib/hwasan/hwasan.cpp index 6b4aefc..0401783 100644 --- a/compiler-rt/lib/hwasan/hwasan.cpp +++ b/compiler-rt/lib/hwasan/hwasan.cpp @@ -276,7 +276,6 @@ static void InitInstrumentation() { } InitThreads(); - hwasanThreadList().CreateCurrentThread(); hwasan_instrumentation_inited = 1; } diff --git a/compiler-rt/lib/hwasan/hwasan_linux.cpp b/compiler-rt/lib/hwasan/hwasan_linux.cpp index 8fbb8ee..bc5ac3b 100644 --- a/compiler-rt/lib/hwasan/hwasan_linux.cpp +++ b/compiler-rt/lib/hwasan/hwasan_linux.cpp @@ -250,6 +250,7 @@ void InitThreads() { 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) { -- 2.7.4