[asan] second attempt to use TLS with fake stack. This time it looks (more) async-signal safe.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190663 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/asan/asan_thread.h b/lib/asan/asan_thread.h
index 8633e5d..29e30ff 100644
--- a/lib/asan/asan_thread.h
+++ b/lib/asan/asan_thread.h
@@ -78,7 +78,10 @@
void DeleteFakeStack() {
if (!fake_stack_) return;
fake_stack_->PoisonAll(0);
- fake_stack_->Destroy();
+ FakeStack *t = fake_stack_;
+ fake_stack_ = 0;
+ SetTLSFakeStack(0);
+ t->Destroy();
}
bool has_fake_stack() {