diff options
author | Anna Zaks <ganna@apple.com> | 2011-09-30 02:19:19 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2011-09-30 02:19:19 +0000 |
commit | 819b0d861919c8fb0a48d439f272a82012e1c7b8 (patch) | |
tree | 8ae5471e6f01dccdb3f82b9a2f29371eef9667f6 | |
parent | 7769a777103dade80510141047d971baf8081fce (diff) | |
download | bcm5719-llvm-819b0d861919c8fb0a48d439f272a82012e1c7b8.tar.gz bcm5719-llvm-819b0d861919c8fb0a48d439f272a82012e1c7b8.zip |
[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).
llvm-svn: 140840
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp | 2 | ||||
-rw-r--r-- | clang/test/Analysis/plist-output-alternate.m | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp index 7791d9d7114..695cc037e86 100644 --- a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp @@ -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, diff --git a/clang/test/Analysis/plist-output-alternate.m b/clang/test/Analysis/plist-output-alternate.m index b3a0564289f..23a260a129c 100644 --- a/clang/test/Analysis/plist-output-alternate.m +++ b/clang/test/Analysis/plist-output-alternate.m @@ -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 '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> |