pr4209.m revision 63e963cdffca9530f920dbab58b9b4eecb2a582c
1// 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 3 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; 52-(NSString*) categoryID; 53@end @interface GSEbayCategory : NSObject <NSCoding> { 54} 55- (int) categoryID; 56- (GSEbayCategory *) parent; 57- (GSEbayCategory*) subcategoryWithID:(int) inID; 58@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}} 61 return 0; 62} 63- (void) addCategory:(EBayCategoryType*)inCategory toRootTreeCategory:(NSMutableArray*)inRootTreeCategories { 64 GSEbayCategory *category = [rootCategory subcategoryWithID:[[inCategory categoryID] intValue]]; 65 66 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} 75@end 76