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