re PR java/21418 (Order of source files matters when compiling)
authorRanjit Mathew <rmathew@gcc.gnu.org>
Wed, 21 Sep 2005 13:34:28 +0000 (13:34 +0000)
committerRanjit Mathew <rmathew@gcc.gnu.org>
Wed, 21 Sep 2005 13:34:28 +0000 (13:34 +0000)
PR java/21418
* class.c (inherits_from_p): Try to lay out super class
if it is not already laid out.
(maybe_layout_super_class): Handle the case where SUPER_CLASS
is a NULL_TREE.

From-SVN: r104483

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

index b6299790f076cb536a5af44af85e9054797194c1..3cf82e3efde3a5775c9ec3d962be2173ef81aed6 100644 (file)
@@ -1,3 +1,11 @@
+2005-09-21  Ranjit Mathew  <rmathew@gcc.gnu.org>
+
+       PR java/21418
+       * class.c (inherits_from_p): Try to lay out super class
+       if it is not already laid out.
+       (maybe_layout_super_class): Handle the case where SUPER_CLASS
+       is a NULL_TREE.
+
 2005-09-18  James A. Morrison  <phython@gcc.gnu.org>
 
        * builtins.c (max_builtin, min_builtin, abs_builtin,
index 47ae3368363968a5588fda26669e93995a86e12f..b9848d30f268db7fd140e8e0a7991253f7409ef1 100644 (file)
@@ -549,9 +549,11 @@ inherits_from_p (tree type1, tree type2)
     {
       if (type1 == type2)
        return 1;
+
       if (! CLASS_LOADED_P (type1))
        load_class (type1, 1);
-      type1 = CLASSTYPE_SUPER (type1);
+
+      type1 = maybe_layout_super_class (CLASSTYPE_SUPER (type1), type1);
     }
   return 0;
 }
@@ -2058,7 +2060,9 @@ push_super_field (tree this_class, tree super_class)
 static tree
 maybe_layout_super_class (tree super_class, tree this_class)
 {
-  if (TREE_CODE (super_class) == RECORD_TYPE)
+  if (!super_class)
+    return NULL_TREE;
+  else if (TREE_CODE (super_class) == RECORD_TYPE)
     {
       if (!CLASS_LOADED_P (super_class) && CLASS_FROM_SOURCE_P (super_class))
        safe_layout_class (super_class);