|
|
Hi!
http://gcc.gnu.org/ml/gcc-patches/2009-11/msg01059.html
broke completely Obj-C++. The problem is the new set_underlying_type
call in build_self_reference, which creates a new type variant.
The ObjC FE apparently isn't prepared to see such a type variant in
objc_build_struct, expects that all type variants have already
TYPE_OBJC_INFO initialized.
The following patch fixes it, bootstrapped/regtested on x86_64-linux, fixes
all the recent obj-c++ regressions.
2009-11-27 Jakub Jelinek <jakub@xxxxxxxxxx>
PR obj-c++/42156
* objc-act.c (objc_build_struct): INIT_TYPE_OBJC_INFO for
type variants that don't have it initialized yet.
--- gcc/objc/objc-act.c.jj 2009-11-18 15:48:40.000000000 +0100
+++ gcc/objc/objc-act.c 2009-11-26 10:41:05.000000000 +0100
@@ -871,9 +871,16 @@ objc_build_struct (tree klass, tree fiel
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);
Jakub
|
|