From 4a25f3056416aaffa7852985c2045634e5275876 Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Sat, 1 Sep 2012 17:39:13 +0000 Subject: [PATCH] [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 --- lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp | 8 ++++---- 1 file 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(&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); -- 2.40.0