summaryrefslogtreecommitdiff
path: root/lib/asan/asan_thread.h
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2013-09-12 08:43:44 +0000
committerKostya Serebryany <kcc@google.com>2013-09-12 08:43:44 +0000
commitdcf98bf49d68533c7aebadbf6c4467afdd486c99 (patch)
treee25686584829ffff5c04569433706715210752e7 /lib/asan/asan_thread.h
parentc98fc1f8e52812cfaf5b19a29db5ed56acb0a682 (diff)
downloadcompiler-rt-dcf98bf49d68533c7aebadbf6c4467afdd486c99.tar.gz
compiler-rt-dcf98bf49d68533c7aebadbf6c4467afdd486c99.tar.bz2
compiler-rt-dcf98bf49d68533c7aebadbf6c4467afdd486c99.tar.xz
[asan] don't lazy-init fake_stack if we only need to check that fake_stack exists (should fix 32-bit builds)
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190593 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_thread.h')
-rw-r--r--lib/asan/asan_thread.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/asan/asan_thread.h b/lib/asan/asan_thread.h
index 55c39966..8633e5db 100644
--- a/lib/asan/asan_thread.h
+++ b/lib/asan/asan_thread.h
@@ -81,8 +81,12 @@ class AsanThread {
fake_stack_->Destroy();
}
+ bool has_fake_stack() {
+ return (reinterpret_cast<uptr>(fake_stack_) > 1);
+ }
+
FakeStack *fake_stack() {
- if (reinterpret_cast<uptr>(fake_stack_) <= 1)
+ if (!has_fake_stack())
return AsyncSignalSafeLazyInitFakeStack();
return fake_stack_;
}