[compiler-rt] r190593 - [asan] don't lazy-init fake_stack if we only need to check that fake_stack exists (should fix 32-bit builds)
Kostya Serebryany
kcc at google.com
Thu Sep 12 01:43:44 PDT 2013
Author: kcc
Date: Thu Sep 12 03:43:44 2013
New Revision: 190593
URL: http://llvm.org/viewvc/llvm-project?rev=190593&view=rev
Log:
[asan] don't lazy-init fake_stack if we only need to check that fake_stack exists (should fix 32-bit builds)
Modified:
compiler-rt/trunk/lib/asan/asan_thread.cc
compiler-rt/trunk/lib/asan/asan_thread.h
Modified: compiler-rt/trunk/lib/asan/asan_thread.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_thread.cc?rev=190593&r1=190592&r2=190593&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_thread.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_thread.cc Thu Sep 12 03:43:44 2013
@@ -187,7 +187,7 @@ const char *AsanThread::GetFrameNameByAd
uptr bottom = 0;
if (AddrIsInStack(addr)) {
bottom = stack_bottom();
- } else if (fake_stack()) {
+ } else if (has_fake_stack()) {
bottom = fake_stack()->AddrIsInFakeStack(addr);
CHECK(bottom);
*offset = addr - bottom;
Modified: compiler-rt/trunk/lib/asan/asan_thread.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_thread.h?rev=190593&r1=190592&r2=190593&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_thread.h (original)
+++ compiler-rt/trunk/lib/asan/asan_thread.h Thu Sep 12 03:43:44 2013
@@ -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_;
}
More information about the llvm-commits
mailing list