blob: be927660913610f3fa1ad9366a0b089a082072d5 [file] [log] [blame]
Ted Kremenek033a07e2011-08-03 23:14:55 +00001// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -verify %s
Ted Kremeneke6fbdf52009-03-12 22:15:08 +00002//
3// This test case simply should not crash. It evaluates the logic of not
4// using MemRegion::getRValueType in incorrect places.
5
6typedef signed char BOOL;
7typedef unsigned int NSUInteger;
8@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
9@protocol NSObject - (BOOL)isEqual:(id)object;
10- (Class)class;
11- (BOOL)isLegOfClass:(Class)aClass;
12@end @protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder;
13@end @interface NSObject <NSObject> {
14}
15@end @class NSArray;
16@interface NSResponder : NSObject <NSCoding> {
17}
18@end @class NSAttributedString, NSEvent, NSFont, NSFormatter, NSImage, NSMenu, NSText, NSView;
19@class JabasectItem;
20@protocol EcoClassifier;
Chris Lattner58fe03b2009-04-12 08:43:13 +000021@protocol EcoClassInterfaceCommons <EcoClassifier> @end @protocol EcoImplementation;
Ted Kremeneke6fbdf52009-03-12 22:15:08 +000022@protocol EcoBehavioredClassifier <EcoClassInterfaceCommons> - (NSArray *) implementations;
23@end enum {
24CK_UNRESTRICTED= 0, CK_READ_ONLY, CK_ADD_ONLY, CK_REMOVE_ONLY };
25@protocol EcoClass <EcoBehavioredClassifier> - (NSArray *) ownedAttributes;
26@end @protocol EcoNamespace;
27@protocol EcoType;
Chris Lattner58fe03b2009-04-12 08:43:13 +000028@protocol EcoClassifier <EcoNamespace,EcoType> - (NSArray *) features;
Ted Kremeneke6fbdf52009-03-12 22:15:08 +000029@end @protocol EcoComment;
30@protocol EcoElement <NSObject> - (NSArray *) ownedElements;
31@end @protocol EcoDirectedRelationship;
32@protocol EcoNamedElement <EcoElement> - (NSString *) name;
33@end extern NSString *const JabaPathSeparator;
34@protocol EcoNamespace <EcoNamedElement> - (NSArray *) Legs;
35@end enum {
36PDK_IN=0, PDK_INOUT, PDK_OUT, PDK_RETURN };
37@interface EcoElementImp : NSObject <EcoElement, NSCoding> {
38}
39@end @class EcoNamespace;
40@interface EcoNamedElementImp : EcoElementImp <EcoNamedElement>{
41}
42@end @interface EcoNamespaceImp : EcoNamedElementImp <EcoNamespace> {
43}
44@end @class JabaSCDocController, JabaSCDisplaySpecification;
45@interface JabaSCSharedDiagramViewController : NSObject {
46}
47@end extern NSString *const JabaSCsectGraphicNamesectIdentifier;
48@interface EcoClassifierImp : EcoNamespaceImp <EcoClassifier> {
49}
50@end @class EcoOperationImp;
51@interface EcoClassImp : EcoClassifierImp <EcoClass> {
52}
53@end extern NSString *const JabaAddedUMLElements;
54@class JabaSCClass, JabaSCInterface, JabaSCOperation;
55@class DosLegVaseSymbol, DosProtocolSymbol, DosMethodSymbol, DosFileReference;
56@interface HancodeFett : NSObject {
57}
58+ (DosLegVaseSymbol *) symbolFromClass: (JabaSCClass *) clz;
59@end enum _JabaSourceLanguage {
60JabaSourceUnknown=0, JabaSourcePrawn, JabaSourceC, JabaSourceCPP, JabaSourceObjectiveC };
61typedef NSUInteger JabaSourceLanguage;
62@protocol JabaSCClassifier <EcoClassInterfaceCommons> - (JabaSourceLanguage)language;
63@end @interface JabaSCClass : EcoClassImp <JabaSCClassifier> {
64}
65@end @class DosGlobalID, DosPQuLC, DosPQuUnLC;
66@protocol XCProxyObjectProtocol - (id) representedObject;
67@end typedef union _Dossymbollocation {
68}
69 DosRecordArrPrl;
70@interface DosIndexEntry : NSObject {
71}
72@end @class DosProjectIndex, DosTextPapyruswiggle, DosDocPapyruswiggle, DosLegVaseSymbol;
73@interface DosSymbol : DosIndexEntry {
74}
75@end @interface DosLegVaseSymbol : DosSymbol {
76}
77@end typedef enum _DosTextRangeType {
78Dos_CharacterRangeType = 0, Dos_LineRangeType = 1 }
79 DosTextRangeType;
80@implementation JabaSCSharedDiagramViewController + (NSImage *)findImageNamed:(NSString *)name {
Mike Stumpb8a087e2009-07-21 19:01:01 +000081 return 0;
Ted Kremeneke6fbdf52009-03-12 22:15:08 +000082}
83- (void)revealSourceInEditor:(JabasectItem *)sectItem duperGesture:(BOOL)duperGesture {
84 id <EcoNamedElement> selectedElement = [sectItem representedObject];
85 id <EcoNamedElement> selectedClassifier = selectedElement;
86 DosSymbol *symbol=((void *)0);
87 if([selectedClassifier isLegOfClass:[JabaSCClass class]]) {
88 symbol = [HancodeFett symbolFromClass:(JabaSCClass *) selectedClassifier];
89 }
90}
Fariborz Jahanian63e963c2009-11-16 18:57:01 +000091@end