[cfe-commits] r163067 - /cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
Jordan Rose
jordan_rose at apple.com
Sat Sep 1 10:39:13 PDT 2012
Author: jrose
Date: Sat Sep 1 12:39:13 2012
New Revision: 163067
URL: http://llvm.org/viewvc/llvm-project?rev=163067&view=rev
Log:
[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.
Modified:
cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp?rev=163067&r1=163066&r2=163067&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp Sat Sep 1 12:39:13 2012
@@ -947,12 +947,12 @@
// 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);
More information about the cfe-commits
mailing list