[cfe-commits] r140840 - in /cfe/trunk: lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp test/Analysis/plist-output-alternate.m

Anna Zaks ganna at apple.com
Thu Sep 29 19:19:20 PDT 2011


Author: zaks
Date: Thu Sep 29 21:19:19 2011
New Revision: 140840

URL: http://llvm.org/viewvc/llvm-project?rev=140840&view=rev
Log:
[analyzer] Fix a bug in RetainReleaseChecker diagnostics. It gives more precise error message on the modified test case (and prevents duplicate diagnostics when we purge at block granularity).

Modified:
    cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
    cfe/trunk/test/Analysis/plist-output-alternate.m

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp?rev=140840&r1=140839&r2=140840&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp Thu Sep 29 21:19:19 2011
@@ -3436,7 +3436,7 @@
   const ProgramState *state = Builder.getState();
   GenericNodeBuilderRefCount Bd(Builder);
   RefBindings B = state->get<RefBindings>();
-  ExplodedNode *Pred = 0;
+  ExplodedNode *Pred = Builder.getPredecessor();
 
   for (RefBindings::iterator I = B.begin(), E = B.end(); I != E; ++I) {
     llvm::tie(Pred, state) = handleAutoreleaseCounts(state, Bd, Pred, Eng,

Modified: cfe/trunk/test/Analysis/plist-output-alternate.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/plist-output-alternate.m?rev=140840&r1=140839&r2=140840&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/plist-output-alternate.m (original)
+++ cfe/trunk/test/Analysis/plist-output-alternate.m Thu Sep 29 21:19:19 2011
@@ -992,7 +992,7 @@
 // CHECK:    </array>
 // CHECK:    <key>description</key><string>Potential leak of an object allocated on line 53 and stored into 'value'</string>
 // CHECK:    <key>category</key><string>Memory (Core Foundation/Objective-C)</string>
-// CHECK:    <key>type</key><string>Leak of returned object</string>
+// CHECK:    <key>type</key><string>Leak</string>
 // CHECK:   <key>location</key>
 // CHECK:   <dict>
 // CHECK:    <key>line</key><integer>57</integer>





More information about the cfe-commits mailing list