diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index 4a18eadab1d..65d0282ac00 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,9 @@ +2009-11-28 Jakub Jelinek + + PR obj-c++/42156 + * objc-act.c (objc_build_struct): INIT_TYPE_OBJC_INFO for + type variants that don't have it initialized yet. + 2009-09-14 Jan Hubicka * objc-act.c (objc_add_static_instance): Do not set DECL_COMMON. diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 6884cb17492..e720dab39ff 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -871,9 +871,16 @@ objc_build_struct (tree klass, tree fields, tree super_name) finish_struct(), and then reinstate it afterwards. */ for (t = TYPE_NEXT_VARIANT (s); t; t = TYPE_NEXT_VARIANT (t)) - objc_info - = chainon (objc_info, - build_tree_list (NULL_TREE, TYPE_OBJC_INFO (t))); + { + if (!TYPE_HAS_OBJC_INFO (t)) + { + INIT_TYPE_OBJC_INFO (t); + TYPE_OBJC_INTERFACE (t) = klass; + } + objc_info + = chainon (objc_info, + build_tree_list (NULL_TREE, TYPE_OBJC_INFO (t))); + } /* Point the struct at its related Objective-C class. */ INIT_TYPE_OBJC_INFO (s);