Recently the GCD tests started failing because of the invalid size of
FakeStack on the worker threads.
This patch moves the AsanThread initialization into a separate
procedure that's called when AsanThread objects are called for worker
threads.
Patch by glider@google.com
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@146752 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/asan/asan_thread.cc b/lib/asan/asan_thread.cc
index 27fa2fe..a71ad8d 100644
--- a/lib/asan/asan_thread.cc
+++ b/lib/asan/asan_thread.cc
@@ -51,7 +51,7 @@
real_memset((void*)shadow_bot, 0, shadow_top - shadow_bot);
}
-void *AsanThread::ThreadStart() {
+void AsanThread::Init() {
SetThreadStackTopAndBottom();
fake_stack_.Init(stack_size());
if (FLAG_v >= 1) {
@@ -65,6 +65,10 @@
CHECK(AddrIsInMem(stack_top_));
ClearShadowForThreadStack();
+}
+
+void *AsanThread::ThreadStart() {
+ Init();
if (!start_routine_) {
// start_routine_ == NULL if we're on the main thread or on one of the