diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-09-01 17:39:13 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-09-01 17:39:13 +0000 |
commit | 4a25f3056416aaffa7852985c2045634e5275876 (patch) | |
tree | 88b1f0d8a194b56466636d182191bd1baa1a2abe /lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp | |
parent | 02df4f0aef142f00d4637cd851e54da2a123ca8e (diff) |
[analyzer] Future-proofing r163012 (nameless functions and RetainCountChecker)
Any future exceptions need to go INSIDE the test that checks if the
IdentifierInfo is non-null!
No functionality change. Thanks for the review, Ted.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163067 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp b/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp index 94e905cbf1..176f618a2b 100644 --- a/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp @@ -947,12 +947,12 @@ void RetainSummaryManager::updateSummaryForCall(const RetainSummary *&S, // This can generally only happen if we know that the callback will only be // called when the return value is already being deallocated. if (const FunctionCall *FC = dyn_cast<FunctionCall>(&Call)) { - IdentifierInfo *Name = FC->getDecl()->getIdentifier(); - - // This callback frees the associated buffer. - if (Name) + if (IdentifierInfo *Name = FC->getDecl()->getIdentifier()) { + // When the CGBitmapContext is deallocated, the callback here will free + // the associated data buffer. if (Name->isStr("CGBitmapContextCreateWithData")) RE = S->getRetEffect(); + } } S = getPersistentSummary(RE, RecEffect, DefEffect); |