From a93770efeb027ef5c21c5d4f60dae01fc820c4f0 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Fri, 14 Oct 2005 08:46:55 +0000 Subject: [PATCH] re PR java/23620 (Segfault compiling inner interfaces) PR java/23620 * class.c (make_class): Create empty binfo here. (set_super_info): Only create binfo if we have superclasses. Co-Authored-By: Wil Mahan From-SVN: r105399 --- gcc/java/ChangeLog | 7 +++++++ gcc/java/class.c | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 549a742f398d..33c01d7d146d 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,10 @@ +2005-10-12 Nathan Sidwell + Wil Mahan + + PR java/23620 + * class.c (make_class): Create empty binfo here. + (set_super_info): Only create binfo if we have superclasses. + 2005-10-03 Ranjit Mathew PR java/24127 diff --git a/gcc/java/class.c b/gcc/java/class.c index b9848d30f268..eb9ea71fdb5c 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -319,6 +319,9 @@ make_class (void) { tree type; type = make_node (RECORD_TYPE); + /* Unfortunately we must create the binfo here, so that class + loading works. */ + TYPE_BINFO (type) = make_tree_binfo (0); MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC (type); return type; @@ -468,7 +471,8 @@ set_super_info (int access_flags, tree this_class, if (super_class) total_supers++; - TYPE_BINFO (this_class) = make_tree_binfo (total_supers); + if (total_supers) + TYPE_BINFO (this_class) = make_tree_binfo (total_supers); TYPE_VFIELD (this_class) = TYPE_VFIELD (object_type_node); if (super_class) {