tsan: don't crash with NULL deref during reporting

tctx==NULL crash observed during deadlock reporting.
There seems to be some bugs in the deadlock detector,
but it is still useful to be more robust during reporting.

llvm-svn: 224508
This commit is contained in:
Dmitry Vyukov 2014-12-18 10:19:32 +00:00
parent a4cd69217b
commit e1881269f8
1 changed files with 3 additions and 1 deletions

View File

@ -251,7 +251,9 @@ ThreadContext *IsThreadStackOrTls(uptr addr, bool *is_stack) {
void ScopedReport::AddThread(int unique_tid, bool suppressable) {
#ifndef SANITIZER_GO
AddThread(FindThreadByUidLocked(unique_tid), suppressable);
const ThreadContext *tctx = FindThreadByUidLocked(unique_tid);
if (tctx)
AddThread(FindThreadByUidLocked(unique_tid), suppressable);
#endif
}