Tweak the ObjCAtSyncChecker to assume that a mutex is non-nil after checking that it is
nil. Otherwise we can get false paths where a second @synchronized using the mutex
can have a bogus warning. Fixes <rdar://problem/8578650>.
llvm-svn: 117016
diff --git a/clang/lib/Checker/ObjCAtSyncChecker.cpp b/clang/lib/Checker/ObjCAtSyncChecker.cpp
index dc2e664..4158095 100644
--- a/clang/lib/Checker/ObjCAtSyncChecker.cpp
+++ b/clang/lib/Checker/ObjCAtSyncChecker.cpp
@@ -75,13 +75,15 @@
Ex);
C.EmitReport(report);
+ return;
}
}
- // From this point forward, we know that the mutex is null.
- C.addTransition(nullState);
+ // Don't add a transition for 'nullState'. If the value is
+ // under-constrained to be null or non-null, assume it is non-null
+ // afterwards.
}
if (notNullState)
C.addTransition(notNullState);
}
-
+