summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-09-01 17:39:13 +0000
committerJordan Rose <jordan_rose@apple.com>2012-09-01 17:39:13 +0000
commitccf192e469a802bf7527c6b4b9c3fe5f3982999f (patch)
treeca6dac546d123ebe9992162879d860c6b45e8153 /clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
parent82ae9898efba917c149bcb7eea611756f93df0f7 (diff)
downloadbcm5719-llvm-ccf192e469a802bf7527c6b4b9c3fe5f3982999f.tar.gz
bcm5719-llvm-ccf192e469a802bf7527c6b4b9c3fe5f3982999f.zip
[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. llvm-svn: 163067
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
index 94e905cbf12..176f618a2bd 100644
--- a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud