[cfe-commits] r103717 - in /cfe/trunk: lib/Analysis/CFG.cpp test/Analysis/misc-ps.m
Ted Kremenek
kremenek at apple.com
Thu May 13 09:38:08 PDT 2010
Author: kremenek
Date: Thu May 13 11:38:08 2010
New Revision: 103717
URL: http://llvm.org/viewvc/llvm-project?rev=103717&view=rev
Log:
Don't add a null successor to a CFGBlock when the contents of an @synchronized statement is empty.
Fixes <rdar://problem/7979430>.
Modified:
cfe/trunk/lib/Analysis/CFG.cpp
cfe/trunk/test/Analysis/misc-ps.m
Modified: cfe/trunk/lib/Analysis/CFG.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFG.cpp?rev=103717&r1=103716&r2=103717&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/CFG.cpp (original)
+++ cfe/trunk/lib/Analysis/CFG.cpp Thu May 13 11:38:08 2010
@@ -1223,10 +1223,9 @@
return 0;
Block = 0;
+ Succ = SyncBlock;
}
- Succ = SyncBlock;
-
// Inline the sync expression.
return addStmt(S->getSynchExpr());
}
Modified: cfe/trunk/test/Analysis/misc-ps.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps.m?rev=103717&r1=103716&r2=103717&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/misc-ps.m (original)
+++ cfe/trunk/test/Analysis/misc-ps.m Thu May 13 11:38:08 2010
@@ -957,3 +957,13 @@
}) == 0) {
}
}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/7979430> - The CFG for code containing an empty
+// @synchronized block was previously broken (and would crash the analyzer).
+//===----------------------------------------------------------------------===//
+
+void r7979430(id x) {
+ @synchronized(x) {}
+}
+
More information about the cfe-commits
mailing list