Ted Kremenek | 8382cf5 | 2009-11-13 18:46:29 +0000 | [diff] [blame] | 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 |
Ted Kremenek | 70b6a83 | 2009-05-13 18:16:01 +0000 | [diff] [blame] | 3 | |
| 4 | // This test case was crashing due to how CFRefCount.cpp resolved the |
| 5 | // ObjCInterfaceDecl* and ClassName in EvalObjCMessageExpr. |
| 6 | |
| 7 | typedef signed char BOOL; |
| 8 | typedef unsigned int NSUInteger; |
| 9 | typedef 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; |
| 18 | typedef struct _NSPoint { |
| 19 | } |
| 20 | NSFastEnumerationState; |
| 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 | } |
| 35 | CMProfileLocation; |
| 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 Jahanian | 63e963c | 2009-11-16 18:57:01 +0000 | [diff] [blame] | 52 | -(NSString*) categoryID; |
Ted Kremenek | 70b6a83 | 2009-05-13 18:16:01 +0000 | [diff] [blame] | 53 | @end @interface GSEbayCategory : NSObject <NSCoding> { |
| 54 | } |
| 55 | - (int) categoryID; |
| 56 | - (GSEbayCategory *) parent; |
| 57 | - (GSEbayCategory*) subcategoryWithID:(int) inID; |
Fariborz Jahanian | 63e963c | 2009-11-16 18:57:01 +0000 | [diff] [blame] | 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}} |
Mike Stump | 6581c30 | 2009-07-21 18:57:14 +0000 | [diff] [blame] | 61 | return 0; |
Ted Kremenek | 70b6a83 | 2009-05-13 18:16:01 +0000 | [diff] [blame] | 62 | } |
| 63 | - (void) addCategory:(EBayCategoryType*)inCategory toRootTreeCategory:(NSMutableArray*)inRootTreeCategories { |
Fariborz Jahanian | 63e963c | 2009-11-16 18:57:01 +0000 | [diff] [blame] | 64 | GSEbayCategory *category = [rootCategory subcategoryWithID:[[inCategory categoryID] intValue]]; |
| 65 | |
Ted Kremenek | 70b6a83 | 2009-05-13 18:16:01 +0000 | [diff] [blame] | 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 | } |
Fariborz Jahanian | 63e963c | 2009-11-16 18:57:01 +0000 | [diff] [blame] | 75 | @end |