[asan] don't lazy-init fake_stack if we only need to check that fake_stack exists (should fix 32-bit builds)

llvm-svn: 190593
This commit is contained in:
Kostya Serebryany 2013-09-12 08:43:44 +00:00
parent 628cda7367
commit 736bd08e05
2 changed files with 6 additions and 2 deletions

View File

@ -187,7 +187,7 @@ const char *AsanThread::GetFrameNameByAddr(uptr addr, uptr *offset,
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;

View File

@ -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_;
}