[asan] Fix a crash in GetCurrent() of an undead thread.

llvm-svn: 150371
This commit is contained in:
Evgeniy Stepanov 2012-02-13 11:53:24 +00:00
parent f81b9d172a
commit 56ae29f92d
1 changed files with 1 additions and 1 deletions

View File

@ -73,7 +73,7 @@ AsanThread *AsanThreadRegistry::GetCurrent() {
// limits, so only do this magic on Android, and only if the found thread is
// the main thread.
AsanThread* thread = FindThreadByStackAddress((uintptr_t)&summary);
if (thread->tid() == 0) {
if (thread && thread->tid() == 0) {
SetCurrent(thread);
return thread;
}