aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/objc/ChangeLog6
-rw-r--r--gcc/objc/objc-act.c13
2 files changed, 16 insertions, 3 deletions
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index 4a18ead..65d0282 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-28 Jakub Jelinek <jakub@redhat.com>
+
+ 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 <jh@suse.cz>
* 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 6884cb1..e720dab 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);