From 176e2c519dba1a6883e8a1e6d38106750f1d74f6 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 15 Jul 2008 17:43:41 +0000 Subject: isRetain() and isRelease() now only returns true if "Retain"/"Release" appears in the suffix of a function's name. llvm-svn: 53621 --- clang/lib/Analysis/CFRefCount.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'clang/lib/Analysis/CFRefCount.cpp') diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp index 1777071c699..db7334f298d 100644 --- a/clang/lib/Analysis/CFRefCount.cpp +++ b/clang/lib/Analysis/CFRefCount.cpp @@ -694,11 +694,13 @@ RetainSummary* RetainSummaryManager::getNSSummary(FunctionDecl* FD, } static bool isRetain(FunctionDecl* FD, const char* FName) { - return (strstr(FName, "Retain") != 0); + const char* loc = strstr(FName, "Retain"); + return loc && loc[sizeof("Retain")-1] == '\0'; } static bool isRelease(FunctionDecl* FD, const char* FName) { - return (strstr(FName, "Release") != 0); + const char* loc = strstr(FName, "Release"); + return loc && loc[sizeof("Release")-1] == '\0'; } RetainSummary* RetainSummaryManager::getCFSummary(FunctionDecl* FD, -- cgit v1.2.3