This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[BC ABI] Merged with HEAD
A couple of silly casts were missing in the front end.
I imagine there will be more of these. :-(
Andrew.
2004-05-24 Andrew Haley <aph@redhat.com>
* expr.c (build_known_method_ref): Make sure ARRAY_REF access to
atable element is of the right type.
* class.c (build_static_field_ref): Cast pointer to correct type
for field.
Index: class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/class.c,v
retrieving revision 1.180.2.3
diff -u -w -r1.180.2.3 class.c
--- class.c 20 May 2004 23:32:49 -0000 1.180.2.3
+++ class.c 24 May 2004 16:50:27 -0000
@@ -1102,7 +1102,7 @@
else
{
/* Compile as:
- * *(FTYPE*)build_class_ref(FCLASS)->fields[INDEX].info.addr */
+ *(FTYPE*)build_class_ref(FCLASS)->fields[INDEX].info.addr */
tree ref = build_class_ref (fclass);
tree fld;
int field_index = 0;
@@ -1128,6 +1128,7 @@
ref, lookup_field (&field_type_node, info_ident));
ref = build (COMPONENT_REF, ptr_type_node,
ref, TREE_CHAIN (TYPE_FIELDS (field_info_union_node)));
+ ref = convert (build_pointer_type (TREE_TYPE (fdecl)), ref);
return fold (build1 (INDIRECT_REF, TREE_TYPE(fdecl), ref));
}
}
Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/expr.c,v
retrieving revision 1.185.2.3
diff -u -w -r1.185.2.3 expr.c
--- expr.c 20 May 2004 23:32:50 -0000 1.185.2.3
+++ expr.c 24 May 2004 16:50:28 -0000
@@ -1885,7 +1885,8 @@
build_int_2 (get_symbol_table_index
(method, &TYPE_ATABLE_METHODS (output_class)), 0);
func =
- build (ARRAY_REF, method_ptr_type_node,
+ build (ARRAY_REF,
+ TREE_TYPE (TREE_TYPE (TYPE_ATABLE_DECL (output_class))),
TYPE_ATABLE_DECL (output_class), table_index);
}
func = convert (method_ptr_type_node, func);