blob: 60161b1b08a8f9cb6bebc97021da577b3e11916e [file] [log] [blame]
Ted Kremenek8382cf52009-11-13 18:46:29 +00001// RUN: clang-cc -triple i386-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify %s
2// RUN: clang-cc -triple i386-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s
Ted Kremenek70b6a832009-05-13 18:16:01 +00003
4// This test case was crashing due to how CFRefCount.cpp resolved the
5// ObjCInterfaceDecl* and ClassName in EvalObjCMessageExpr.
6
7typedef signed char BOOL;
8typedef unsigned int NSUInteger;
9typedef struct _NSZone NSZone;
10@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
11@protocol NSObject - (BOOL)isEqual:(id)object;
12@end @protocol NSCopying - (id)copyWithZone:(NSZone *)zone;
13@end @protocol NSMutableCopying - (id)mutableCopyWithZone:(NSZone *)zone;
14@end @protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder;
15@end @interface NSObject <NSObject> {
16}
17@end typedef float CGFloat;
18typedef struct _NSPoint {
19}
20NSFastEnumerationState;
21@protocol NSFastEnumeration - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len;
22@end @class NSString;
23@interface NSArray : NSObject <NSCopying, NSMutableCopying, NSCoding, NSFastEnumeration> - (NSUInteger)count;
24@end @interface NSMutableArray : NSArray - (void)addObject:(id)anObject;
25@end typedef unsigned short unichar;
26@interface NSString : NSObject <NSCopying, NSMutableCopying, NSCoding> - (NSUInteger)length;
27- (int)intValue;
28@end @interface NSSimpleCString : NSString {
29}
30@end @interface NSConstantString : NSSimpleCString @end extern void *_NSConstantStringClassReference;
31@interface NSDictionary : NSObject <NSCopying, NSMutableCopying, NSCoding, NSFastEnumeration> - (NSUInteger)count;
32@end @interface NSMutableDictionary : NSDictionary - (void)removeObjectForKey:(id)aKey;
33@end typedef struct {
34}
35CMProfileLocation;
36@interface NSResponder : NSObject <NSCoding> {
37}
38@end @class NSAttributedString, NSEvent, NSFont, NSFormatter, NSImage, NSMenu, NSText, NSView;
39@interface NSCell : NSObject <NSCopying, NSCoding> {
40}
41@end extern NSString *NSControlTintDidChangeNotification;
42@interface NSActionCell : NSCell {
43}
44@end @class NSArray, NSDocument, NSWindow;
45@interface NSWindowController : NSResponder <NSCoding> {
46}
47@end @class EBayCategoryType, GSEbayCategory, GBSearchRequest;
48@interface GBCategoryChooserPanelController : NSWindowController {
49 GSEbayCategory *rootCategory;
50}
51- (NSMutableDictionary*)categoryDictionaryForCategoryID:(int)inID inRootTreeCategories:(NSMutableArray*)inRootTreeCategories;
Fariborz Jahanian63e963c2009-11-16 18:57:01 +000052-(NSString*) categoryID;
Ted Kremenek70b6a832009-05-13 18:16:01 +000053@end @interface GSEbayCategory : NSObject <NSCoding> {
54}
55- (int) categoryID;
56- (GSEbayCategory *) parent;
57- (GSEbayCategory*) subcategoryWithID:(int) inID;
Fariborz Jahanian63e963c2009-11-16 18:57:01 +000058@end @implementation GBCategoryChooserPanelController + (int) chooseCategoryIDFromCategories:(NSArray*) inCategories searchRequest:(GBSearchRequest*)inRequest parentWindow:(NSWindow*) inParent { // expected-warning {{incomplete implementation}} \
59// expected-warning {{method definition for 'categoryDictionaryForCategoryID:inRootTreeCategories:' not found}} \
60// expected-warning {{method definition for 'categoryID' not found}}
Mike Stump6581c302009-07-21 18:57:14 +000061 return 0;
Ted Kremenek70b6a832009-05-13 18:16:01 +000062}
63- (void) addCategory:(EBayCategoryType*)inCategory toRootTreeCategory:(NSMutableArray*)inRootTreeCategories {
Fariborz Jahanian63e963c2009-11-16 18:57:01 +000064 GSEbayCategory *category = [rootCategory subcategoryWithID:[[inCategory categoryID] intValue]];
65
Ted Kremenek70b6a832009-05-13 18:16:01 +000066 if (rootCategory != category) {
67 GSEbayCategory *parent = category;
68 while ((((void*)0) != (parent = [parent parent])) && ([parent categoryID] != 0)) {
69 NSMutableDictionary *treeCategoryDict = [self categoryDictionaryForCategoryID:[parent categoryID] inRootTreeCategories:inRootTreeCategories];
70 if (((void*)0) == treeCategoryDict) {
71 }
72 }
73 }
74}
Fariborz Jahanian63e963c2009-11-16 18:57:01 +000075@end