isRetain() and isRelease() now only returns true if "Retain"/"Release" appears in the suffix of a function's name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53621 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index 1777071..db7334f 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -694,11 +694,13 @@
 }
 
 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,