diff options
author | Bryce McKinlay <bryce@albatross.co.nz> | 2000-12-18 21:15:52 +0000 |
---|---|---|
committer | Bryce McKinlay <bryce@gcc.gnu.org> | 2000-12-18 21:15:52 +0000 |
commit | c1eacb709f2f0ea4ad783e146ac95e21111022fd (patch) | |
tree | 995e46d2de69324ffdd071c2072fcc0de72d8af7 /gcc/java/class.c | |
parent | 25cfec087a0d4de0736e71f729c0a2befec92132 (diff) | |
download | gcc-c1eacb709f2f0ea4ad783e146ac95e21111022fd.zip gcc-c1eacb709f2f0ea4ad783e146ac95e21111022fd.tar.gz gcc-c1eacb709f2f0ea4ad783e146ac95e21111022fd.tar.bz2 |
Fix for PRs gcj/312 and gcj/253:
* parse.y (valid_ref_assignconv_cast_p): Load classes for source and
dest if they arn't already.
* class.c (layout_class): Call maybe_layout_super_class on
superinterfaces also, but only if compiling from bytecode.
From-SVN: r38363
Diffstat (limited to 'gcc/java/class.c')
-rw-r--r-- | gcc/java/class.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/java/class.c b/gcc/java/class.c index 00cf42e..92dd0b9 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -1841,6 +1841,35 @@ layout_class (this_class) layout_type (this_class); + /* Also recursively load/layout any superinterfaces, but only if class was + loaded from bytecode. The source parser will take care of this itself. */ + if (!CLASS_FROM_SOURCE_P (this_class)) + { + tree basetype_vec = TYPE_BINFO_BASETYPES (this_class); + + if (basetype_vec) + { + int n = TREE_VEC_LENGTH (basetype_vec) - 1; + int i; + for (i = n; i > 0; i--) + { + tree vec_elt = TREE_VEC_ELT (basetype_vec, i); + tree super_interface = BINFO_TYPE (vec_elt); + + tree maybe_super_interface + = maybe_layout_super_class (super_interface, NULL_TREE); + if (maybe_super_interface == NULL + || TREE_CODE (TYPE_SIZE (maybe_super_interface)) == ERROR_MARK) + { + TYPE_SIZE (this_class) = error_mark_node; + CLASS_BEING_LAIDOUT (this_class) = 0; + list = TREE_CHAIN (list); + return; + } + } + } + } + /* Convert the size back to an SI integer value */ TYPE_SIZE_UNIT (this_class) = fold (convert (int_type_node, TYPE_SIZE_UNIT (this_class))); |