diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-10-24 20:33:56 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-10-24 20:33:56 +0000 |
commit | f4b3548ac5ba2f82f347fb4312adcff4da3fa592 (patch) | |
tree | 375936f45ca4afcacde9d3b15bb2746c2187f9c3 | |
parent | f9790ae89676d11fde3372403d1c11124bca28d7 (diff) |
This test no longer is marked XFAIL.
Enhance test to include a case where a tracked object escapes because it is stored to a local ivar through a method dispatch to 'self.'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58109 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/Analysis/refcnt_naming.m | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/Analysis/refcnt_naming.m b/test/Analysis/refcnt_naming.m index 5b8b5d18bc..1390cdd73d 100644 --- a/test/Analysis/refcnt_naming.m +++ b/test/Analysis/refcnt_naming.m @@ -1,5 +1,4 @@ // RUN: clang -checker-cfref -verify %s -// XFAIL typedef const struct __CFString * CFStringRef; typedef const struct __CFAllocator * CFAllocatorRef; @@ -12,8 +11,11 @@ typedef signed char BOOL; @interface MyClass : NSObject { + id myObject; } - (NSURL *)myMethod:(NSString *)inString; +- (NSURL *)getMethod:(NSString*)inString; +- (void)addObject:(id)X; @end @implementation MyClass @@ -24,4 +26,17 @@ typedef signed char BOOL; return url; // expected-warning{{leak}} } +- (NSURL *)getMethod:(NSString *)inString +{ + NSURL *url = (NSURL *)CFURLCreateWithString(0, (CFStringRef)inString, 0); + [self addObject:url]; + return url; // no-warning +} + + +- (void)addObject:(id)X +{ + myObject = X; +} + @end |