re PR java/23620 (Segfault compiling inner interfaces)
authorNathan Sidwell <nathan@codesourcery.com>
Fri, 14 Oct 2005 08:46:55 +0000 (08:46 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Fri, 14 Oct 2005 08:46:55 +0000 (08:46 +0000)
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 <wmahan@gmail.com>
From-SVN: r105399

gcc/java/ChangeLog
gcc/java/class.c

index 549a742f398d55746cc2515aa42f5ea3841d2889..33c01d7d146d9f4c37727164bd4171dae67f8c13 100644 (file)
@@ -1,3 +1,10 @@
+2005-10-12  Nathan Sidwell  <nathan@codesourcery.com>
+           Wil Mahan <wmahan@gmail.com>
+
+       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  <rmathew@gcc.gnu.org>
 
        PR java/24127
index b9848d30f268db7fd140e8e0a7991253f7409ef1..eb9ea71fdb5cb67728ac190fcefedcf64d9bc651 100644 (file)
@@ -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)
     {