]> granicus.if.org Git - clang/commitdiff
isRetain() and isRelease() now only returns true if "Retain"/"Release" appears in...
authorTed Kremenek <kremenek@apple.com>
Tue, 15 Jul 2008 17:43:41 +0000 (17:43 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 15 Jul 2008 17:43:41 +0000 (17:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53621 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/CFRefCount.cpp

index 1777071c6996a033b00c25078217730a732a73d0..db7334f298dfc30c2d09181b1a9804683b65aca0 100644 (file)
@@ -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,