diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Analysis/Inputs/system-header-simulator-objc.h | 7 | ||||
-rw-r--r-- | clang/test/Analysis/malloc.m | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/clang/test/Analysis/Inputs/system-header-simulator-objc.h b/clang/test/Analysis/Inputs/system-header-simulator-objc.h index 3e1d9555bbd..8a5d3b6403c 100644 --- a/clang/test/Analysis/Inputs/system-header-simulator-objc.h +++ b/clang/test/Analysis/Inputs/system-header-simulator-objc.h @@ -66,8 +66,11 @@ typedef struct { NSFastEnumerationState; @protocol NSFastEnumeration - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len; @end @class NSString, NSDictionary; -@interface NSValue : NSObject <NSCopying, NSCoding> - (void)getValue:(void *)value; -@end @interface NSNumber : NSValue - (char)charValue; +@interface NSValue : NSObject <NSCopying, NSCoding> ++ (NSValue *)valueWithPointer:(const void *)p; +- (void)getValue:(void *)value; +@end +@interface NSNumber : NSValue - (char)charValue; - (id)initWithInt:(int)value; @end @class NSString; @interface NSArray : NSObject <NSCopying, NSMutableCopying, NSCoding, NSFastEnumeration> - (NSUInteger)count; diff --git a/clang/test/Analysis/malloc.m b/clang/test/Analysis/malloc.m index ad16db52dff..9201c2b75fe 100644 --- a/clang/test/Analysis/malloc.m +++ b/clang/test/Analysis/malloc.m @@ -49,4 +49,9 @@ void _ArrayCreate() { void testNSDataTruePositiveLeak() { char *b = (char *)malloc(12); NSData *d = [[NSData alloc] initWithBytes: b length: 12]; // expected-warning {{Potential leak of memory pointed to by 'b'}} +} + +id wrapInNSValue() { + void *buffer = malloc(4); + return [NSValue valueWithPointer:buffer]; // no-warning }
\ No newline at end of file |