[objc frontend] Do not crash on internal forward classes

Reviewed By: mbouaziz

Differential Revision: D8010231

fbshipit-source-id: 2260fa6
master
Dulma Churchill 7 years ago committed by Facebook Github Bot
parent 87d1f0f241
commit accfc00d82

@ -204,7 +204,7 @@ module CFrontend_decl_funct (T : CModule_type.CTranslation) : CModule_type.CFron
| ObjCPropertyImplDecl (_, obj_c_property_impl_decl_info) ->
process_property_implementation trans_unit_ctx tenv cfg curr_class
obj_c_property_impl_decl_info
| EmptyDecl _ | ObjCIvarDecl _ | ObjCPropertyDecl _ ->
| EmptyDecl _ | ObjCIvarDecl _ | ObjCPropertyDecl _ | ObjCInterfaceDecl _ ->
()
| AccessSpecDecl _
| BlockDecl _
@ -224,7 +224,6 @@ module CFrontend_decl_funct (T : CModule_type.CTranslation) : CModule_type.CFron
| ObjCCategoryDecl _
| ObjCCategoryImplDecl _
| ObjCImplementationDecl _
| ObjCInterfaceDecl _
| ObjCProtocolDecl _
| BuiltinTemplateDecl _
| ClassTemplateDecl _

@ -0,0 +1,21 @@
/*
* Copyright (c) 2018 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <Foundation/NSObject.h>
@interface A : NSObject
@end
@implementation A
- (void)foo {
}
@class B;
@end

@ -0,0 +1,10 @@
/* @generated */
digraph cfg {
"foo#A#instance.a1bcc3cb6c1f00fc285817fb8454eaed_1" [label="1: Start A_foo\nFormals: self:A*\nLocals: \n DECLARE_LOCALS(&return); [line 17, column 1]\n " color=yellow style=filled]
"foo#A#instance.a1bcc3cb6c1f00fc285817fb8454eaed_1" -> "foo#A#instance.a1bcc3cb6c1f00fc285817fb8454eaed_2" ;
"foo#A#instance.a1bcc3cb6c1f00fc285817fb8454eaed_2" [label="2: Exit A_foo \n " color=yellow style=filled]
}

@ -27,6 +27,7 @@ SOURCES = \
../conditional_operation/ConditionalOperation.m \
../exceptions/ExceptionExample.m \
../fast_enumeration/Fast_enumeration.m \
../internal_forward_class/ForwardClassInMethod.m \
../property/PropertyCustomAccessor.m \
../property/PropertyImplSetter.m \
../property/Property_getter.m \

Loading…
Cancel
Save