diff options
author | rmathew <rmathew@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-21 13:34:28 +0000 |
---|---|---|
committer | rmathew <rmathew@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-21 13:34:28 +0000 |
commit | 58bf8f98487de0b21f679fac08a07ef01a073d98 (patch) | |
tree | 7e986cabe57fd40ad4c85697bf8f8f24d7048d6f | |
parent | 6828c286d7f98f8b9defe5c73409478f4ab67339 (diff) | |
download | gcc-58bf8f98487de0b21f679fac08a07ef01a073d98.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104483 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/java/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/java/class.c | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index b6299790f07..3cf82e3efde 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -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, diff --git a/gcc/java/class.c b/gcc/java/class.c index 47ae3368363..b9848d30f26 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -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); |