[gcjx] Patch: FYI: lay out array class

Tom Tromey tromey@redhat.com
Sun Feb 13 04:03:00 GMT 2005


I'm checking this in on the gcjx branch.

We must lay out an array type before we can use it.

In case you're wondering most of these patches came from just running
a simple 'for' loop through jc1 and seeing what crashed.

Tom

# 
# patch "gcc/gcc/java/ChangeLog"
#  from [548275cfa618229aef6a40b44a708d2428503ab3]
#    to [75208a208572e30bec162c925d3928c8d108c266]
# 
# patch "gcc/gcc/java/tree.cc"
#  from [e5a2ad74e4ddc38ee6982ce7e0fbc189cec9fa58]
#    to [e6b555829a1502534585b59f7c8236510b6e66d4]
# 
--- gcc/gcc/java/ChangeLog
+++ gcc/gcc/java/ChangeLog
@@ -1,5 +1,9 @@
 2005-02-09  Tom Tromey  <tromey@redhat.com>
 
+	* tree.cc (visit_array_ref): Lay out array class.
+
+2005-02-09  Tom Tromey  <tromey@redhat.com>
+
 	* tree.cc (visit_for): Wrap body in a LOOP_EXPR.
 
 	* abi.cc (build_method_call): Wrap object in NOP_EXPR before
--- gcc/gcc/java/tree.cc
+++ gcc/gcc/java/tree.cc
@@ -941,6 +941,9 @@
   tree index_tree = current;
   tree component_type
     = gcc_builtins->map_type (array->type ()->element_type ());
+  // We need the array type laid out before we can use it.
+  // FIXME: this should be handled more generically.
+  gcc_builtins->lay_out_class (assert_cast<model_class *> (array->type ()));
 
   current = build_array_reference (array_tree, index_tree,
 				   component_type);



More information about the Java-patches mailing list