From 56ae29f92d11a56ad706346bfbafcaa7b2db1055 Mon Sep 17 00:00:00 2001 From: Evgeniy Stepanov Date: Mon, 13 Feb 2012 11:53:24 +0000 Subject: [PATCH] [asan] Fix a crash in GetCurrent() of an undead thread. llvm-svn: 150371 --- compiler-rt/lib/asan/asan_thread_registry.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler-rt/lib/asan/asan_thread_registry.cc b/compiler-rt/lib/asan/asan_thread_registry.cc index cd48769aa5b7..56208e62a2c4 100644 --- a/compiler-rt/lib/asan/asan_thread_registry.cc +++ b/compiler-rt/lib/asan/asan_thread_registry.cc @@ -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; }