[cfe-commits] r50711 - in /cfe/trunk: lib/Analysis/CFRefCount.cpp test/Analysis-Apple/CFDate.m
Ted Kremenek
kremenek at apple.com
Mon May 5 21:28:05 PDT 2008
Author: kremenek
Date: Mon May 5 23:28:05 2008
New Revision: 50711
URL: http://llvm.org/viewvc/llvm-project?rev=50711&view=rev
Log:
String comparison cleanups.
Added test case.
Modified:
cfe/trunk/lib/Analysis/CFRefCount.cpp
cfe/trunk/test/Analysis-Apple/CFDate.m
Modified: cfe/trunk/lib/Analysis/CFRefCount.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFRefCount.cpp?rev=50711&r1=50710&r2=50711&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Mon May 5 23:28:05 2008
@@ -636,7 +636,7 @@
if (s[0] == '\0')
break;
- if (s[0]!='W' || s[1]!='i' || s[2]!='t' || s[3]!='h')
+ if (!strncmp(s, "With", 4))
break;
return 0;
Modified: cfe/trunk/test/Analysis-Apple/CFDate.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis-Apple/CFDate.m?rev=50711&r1=50710&r2=50711&view=diff
==============================================================================
--- cfe/trunk/test/Analysis-Apple/CFDate.m (original)
+++ cfe/trunk/test/Analysis-Apple/CFDate.m Mon May 5 23:28:05 2008
@@ -2,6 +2,8 @@
#include <CoreFoundation/CFDate.h>
#include <Foundation/NSDate.h>
+#include <Foundation/NSCalendarDate.h>
+#include <Foundation/NSString.h>
CFAbsoluteTime f1() {
CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
@@ -102,3 +104,12 @@
return date; // expected-warning{{leak}}
}
+NSDate* f9(int x) {
+
+ NSDate* date = [NSDate dateWithString:@"2001-03-24 10:45:32 +0600"];
+
+ if (x) [date retain];
+
+ return date; // expected-warning{{leak}}
+}
+
More information about the cfe-commits
mailing list