[cfe-commits] r50714 - /cfe/trunk/lib/Analysis/CFRefCount.cpp

Ted Kremenek kremenek at apple.com
Mon May 5 23:09:10 PDT 2008


Author: kremenek
Date: Tue May  6 01:09:09 2008
New Revision: 50714

URL: http://llvm.org/viewvc/llvm-project?rev=50714&view=rev
Log:
Make string comparison legible and remove buffer overrun introduced by typo.

Modified:
    cfe/trunk/lib/Analysis/CFRefCount.cpp

Modified: cfe/trunk/lib/Analysis/CFRefCount.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFRefCount.cpp?rev=50714&r1=50713&r2=50714&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Tue May  6 01:09:09 2008
@@ -530,8 +530,8 @@
   // "initXXX": pass-through for receiver.
 
   const char* s = S.getIdentifierInfoForSlot(0)->getName();
-    
-  if (s[0] == 'i' && s[10] == 'n' && s[2] == 'i' && s[3] == 't')
+  
+  if (!strncmp(s, "init", 4))
     return getInitMethodSummary(S);
 
   return 0;





More information about the cfe-commits mailing list