2011-08-04 07:14:55 +08:00
|
|
|
// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -analyzer-constraints=basic -verify %s
|
|
|
|
// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -analyzer-constraints=range -verify %s
|
2008-07-02 07:29:51 +08:00
|
|
|
|
|
|
|
// BEGIN delta-debugging reduced header stuff
|
|
|
|
|
|
|
|
typedef struct objc_selector *SEL;
|
|
|
|
typedef signed char BOOL;
|
|
|
|
typedef unsigned int NSUInteger;
|
|
|
|
typedef struct _NSZone NSZone;
|
|
|
|
@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
|
|
|
|
@protocol NSObject
|
|
|
|
- (BOOL)isEqual:(id)object;
|
|
|
|
- (oneway void)release;
|
|
|
|
@end
|
|
|
|
@protocol NSCopying
|
|
|
|
- (id)copyWithZone:(NSZone *)zone;
|
|
|
|
@end
|
|
|
|
@protocol NSMutableCopying
|
|
|
|
- (id)mutableCopyWithZone:(NSZone *)zone;
|
|
|
|
@end
|
|
|
|
@protocol NSCoding
|
|
|
|
- (void)encodeWithCoder:(NSCoder *)aCoder;
|
|
|
|
@end
|
|
|
|
@interface NSObject <NSObject> {}
|
|
|
|
+ (id)alloc;
|
|
|
|
@end
|
|
|
|
typedef float CGFloat;
|
|
|
|
typedef struct _NSPoint {} NSRect;
|
2009-07-22 02:45:22 +08:00
|
|
|
static __inline__ __attribute__((always_inline)) NSRect NSMakeRect(CGFloat x, CGFloat y, CGFloat w, CGFloat h) { NSRect r; return r; }
|
2008-07-02 07:29:51 +08:00
|
|
|
typedef struct {} NSFastEnumerationState;
|
|
|
|
@protocol NSFastEnumeration
|
|
|
|
- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len;
|
|
|
|
@end
|
|
|
|
@class NSString;
|
|
|
|
@interface NSArray : NSObject <NSCopying, NSMutableCopying, NSCoding, NSFastEnumeration>
|
|
|
|
- (NSUInteger)count;
|
|
|
|
@end
|
|
|
|
@interface NSMutableArray : NSArray
|
|
|
|
- (void)addObject:(id)anObject;
|
|
|
|
@end @class NSAppleEventDescriptor;
|
|
|
|
enum { NSBackingStoreRetained = 0, NSBackingStoreNonretained = 1, NSBackingStoreBuffered = 2 };
|
|
|
|
typedef NSUInteger NSBackingStoreType;
|
|
|
|
@interface NSResponder : NSObject <NSCoding> {} @end
|
|
|
|
@protocol NSAnimatablePropertyContainer
|
|
|
|
- (id)animator;
|
|
|
|
@end
|
|
|
|
@protocol NSValidatedUserInterfaceItem
|
|
|
|
- (SEL)action;
|
|
|
|
@end
|
|
|
|
@protocol NSUserInterfaceValidations
|
|
|
|
- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)anItem;
|
|
|
|
@end @class NSDate, NSDictionary, NSError, NSException, NSNotification;
|
|
|
|
enum { NSBorderlessWindowMask = 0, NSTitledWindowMask = 1 << 0, NSClosableWindowMask = 1 << 1, NSMiniaturizableWindowMask = 1 << 2, NSResizableWindowMask = 1 << 3 };
|
|
|
|
@interface NSWindow : NSResponder <NSAnimatablePropertyContainer, NSUserInterfaceValidations> {}
|
|
|
|
- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag;
|
|
|
|
@end
|
|
|
|
extern NSString *NSWindowDidBecomeKeyNotification;
|
|
|
|
@interface NSPanel : NSWindow {}
|
|
|
|
@end
|
|
|
|
@class NSTableHeaderView;
|
|
|
|
|
|
|
|
// END delta-debugging reduced header stuff
|
|
|
|
|
|
|
|
@interface MyClass
|
|
|
|
{
|
|
|
|
NSMutableArray *panels;
|
|
|
|
}
|
|
|
|
- (void)myMethod;
|
|
|
|
- (void)myMethod2;
|
|
|
|
@end
|
2008-07-03 12:29:21 +08:00
|
|
|
|
|
|
|
@implementation MyClass // no-warning
|
2008-07-02 07:29:51 +08:00
|
|
|
- (void)myMethod
|
|
|
|
{
|
|
|
|
NSPanel *panel = [[NSPanel alloc] initWithContentRect:NSMakeRect(0, 0, 200, 200) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:(BOOL)1];
|
|
|
|
|
|
|
|
[panels addObject:panel];
|
|
|
|
|
|
|
|
[panel release]; // no-warning
|
|
|
|
}
|
|
|
|
- (void)myMethod2
|
|
|
|
{
|
2009-04-04 03:02:51 +08:00
|
|
|
NSPanel *panel = [[NSPanel alloc] initWithContentRect:NSMakeRect(0, 0, 200, 200) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:(BOOL)1]; // no-warning
|
2008-07-02 07:29:51 +08:00
|
|
|
|
2009-02-05 07:49:09 +08:00
|
|
|
[panels addObject:panel];
|
2008-07-02 07:29:51 +08:00
|
|
|
}
|
|
|
|
@end
|
|
|
|
|