pr4209.m revision f7a0cf426eddae76e1a71dd2295631a2cf0560af
1// RUN: clang-cc -triple i386-apple-darwin9 -analyze -checker-cfref -analyzer-store=basic -verify %s &&
2// RUN: clang-cc -triple i386-apple-darwin9 -analyze -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 {
59  return 0;
60}
61- (void) addCategory:(EBayCategoryType*)inCategory toRootTreeCategory:(NSMutableArray*)inRootTreeCategories {
62  GSEbayCategory *category = [rootCategory subcategoryWithID:[[inCategory categoryID] intValue]];
63  if (rootCategory != category)  {
64    GSEbayCategory *parent = category;
65    while ((((void*)0) != (parent = [parent parent])) && ([parent categoryID] != 0))   {
66      NSMutableDictionary *treeCategoryDict = [self categoryDictionaryForCategoryID:[parent categoryID] inRootTreeCategories:inRootTreeCategories];
67      if (((void*)0) == treeCategoryDict)    {
68      }
69    }
70  }
71}
72