]> granicus.if.org Git - clang/commitdiff
[analyzer] Fix a bug in RetainReleaseChecker diagnostics. It gives more precise error...
authorAnna Zaks <ganna@apple.com>
Fri, 30 Sep 2011 02:19:19 +0000 (02:19 +0000)
committerAnna Zaks <ganna@apple.com>
Fri, 30 Sep 2011 02:19:19 +0000 (02:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140840 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
test/Analysis/plist-output-alternate.m

index 7791d9d71149860d2b1ab85881d534e51267bbbb..695cc037e86033914ebedc5d36aecc3c920a113b 100644 (file)
@@ -3436,7 +3436,7 @@ void RetainCountChecker::checkEndPath(EndOfFunctionNodeBuilder &Builder,
   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,
index b3a0564289f9f6795cc4b87f3b379e4f8344be10..23a260a129c7affd8effd8470f251f6f7222095a 100644 (file)
@@ -992,7 +992,7 @@ void rdar8331641(int x) {
 // CHECK:    </array>
 // CHECK:    <key>description</key><string>Potential leak of an object allocated on line 53 and stored into &apos;value&apos;</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>