1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -verify %s
2 // expected-no-diagnostics
4 // This test case simply should not crash. It evaluates the logic of not
5 // using MemRegion::getRValueType in incorrect places.
7 typedef signed char BOOL;
8 typedef unsigned int NSUInteger;
9 @class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
10 @protocol NSObject - (BOOL)isEqual:(id)object;
12 - (BOOL)isLegOfClass:(Class)aClass;
13 @end @protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder;
14 @end @interface NSObject <NSObject> {
17 @interface NSResponder : NSObject <NSCoding> {
19 @end @class NSAttributedString, NSEvent, NSFont, NSFormatter, NSImage, NSMenu, NSText, NSView;
21 @protocol EcoClassifier;
22 @protocol EcoClassInterfaceCommons <EcoClassifier> @end @protocol EcoImplementation;
23 @protocol EcoBehavioredClassifier <EcoClassInterfaceCommons> - (NSArray *) implementations;
25 CK_UNRESTRICTED= 0, CK_READ_ONLY, CK_ADD_ONLY, CK_REMOVE_ONLY };
26 @protocol EcoClass <EcoBehavioredClassifier> - (NSArray *) ownedAttributes;
27 @end @protocol EcoNamespace;
28 @protocol EcoType @end;
29 @protocol EcoClassifier <EcoNamespace,EcoType> - (NSArray *) features;
30 @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;
37 PDK_IN=0, PDK_INOUT, PDK_OUT, PDK_RETURN };
38 @interface EcoElementImp : NSObject <EcoElement, NSCoding> {
40 @end @class EcoNamespace;
41 @interface EcoNamedElementImp : EcoElementImp <EcoNamedElement>{
43 @end @interface EcoNamespaceImp : EcoNamedElementImp <EcoNamespace> {
45 @end @class JabaSCDocController, JabaSCDisplaySpecification;
46 @interface JabaSCSharedDiagramViewController : NSObject {
48 @end extern NSString *const JabaSCsectGraphicNamesectIdentifier;
49 @interface EcoClassifierImp : EcoNamespaceImp <EcoClassifier> {
51 @end @class EcoOperationImp;
52 @interface EcoClassImp : EcoClassifierImp <EcoClass> {
54 @end extern NSString *const JabaAddedUMLElements;
55 @class JabaSCClass, JabaSCInterface, JabaSCOperation;
56 @class DosLegVaseSymbol, DosProtocolSymbol, DosMethodSymbol, DosFileReference;
57 @interface HancodeFett : NSObject {
59 + (DosLegVaseSymbol *) symbolFromClass: (JabaSCClass *) clz;
60 @end enum _JabaSourceLanguage {
61 JabaSourceUnknown=0, JabaSourcePrawn, JabaSourceC, JabaSourceCPP, JabaSourceObjectiveC };
62 typedef NSUInteger JabaSourceLanguage;
63 @protocol JabaSCClassifier <EcoClassInterfaceCommons> - (JabaSourceLanguage)language;
64 @end @interface JabaSCClass : EcoClassImp <JabaSCClassifier> {
66 @end @class DosGlobalID, DosPQuLC, DosPQuUnLC;
67 @protocol XCProxyObjectProtocol - (id) representedObject;
68 @end typedef union _Dossymbollocation {
71 @interface DosIndexEntry : NSObject {
73 @end @class DosProjectIndex, DosTextPapyruswiggle, DosDocPapyruswiggle, DosLegVaseSymbol;
74 @interface DosSymbol : DosIndexEntry {
76 @end @interface DosLegVaseSymbol : DosSymbol {
78 @end typedef enum _DosTextRangeType {
79 Dos_CharacterRangeType = 0, Dos_LineRangeType = 1 }
81 @implementation JabaSCSharedDiagramViewController + (NSImage *)findImageNamed:(NSString *)name {
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];