[cfe-commits] r117300 - in /cfe/trunk: lib/Checker/ObjCAtSyncChecker.cpp test/Analysis/misc-ps.m

Ted Kremenek kremenek at apple.com
Mon Oct 25 13:20:57 PDT 2010


Author: kremenek
Date: Mon Oct 25 15:20:56 2010
New Revision: 117300

URL: http://llvm.org/viewvc/llvm-project?rev=117300&view=rev
Log:
Add check for UnknownVals for mutexes in ObjCAtSyncChecker.  Fixes crash reported in PR 8458.

Modified:
    cfe/trunk/lib/Checker/ObjCAtSyncChecker.cpp
    cfe/trunk/test/Analysis/misc-ps.m

Modified: cfe/trunk/lib/Checker/ObjCAtSyncChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/ObjCAtSyncChecker.cpp?rev=117300&r1=117299&r2=117300&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/ObjCAtSyncChecker.cpp (original)
+++ cfe/trunk/lib/Checker/ObjCAtSyncChecker.cpp Mon Oct 25 15:20:56 2010
@@ -57,6 +57,9 @@
     return;
   }
 
+  if (V.isUnknown())
+    return;
+
   // Check for null mutexes.
   const GRState *notNullState, *nullState;
   llvm::tie(notNullState, nullState) = state->Assume(cast<DefinedSVal>(V));

Modified: cfe/trunk/test/Analysis/misc-ps.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps.m?rev=117300&r1=117299&r2=117300&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/misc-ps.m (original)
+++ cfe/trunk/test/Analysis/misc-ps.m Mon Oct 25 15:20:56 2010
@@ -1149,3 +1149,13 @@
   for (; ({ do { } while (0); 0; });) { }
 }
 
+// PR 8458 - Make sure @synchronized doesn't crash with properties.
+ at interface PR8458 {}
+ at property(readonly) id lock;
+ at end
+
+static
+void __PR8458(PR8458 *x) {
+  @synchronized(x.lock) {} // no-warning
+}
+





More information about the cfe-commits mailing list