expr.c (build_java_arrayaccess): Use convert to change len's type.
authorNathan Sidwell <nathan@gcc.gnu.org>
Fri, 20 Aug 2004 09:13:12 +0000 (09:13 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Fri, 20 Aug 2004 09:13:12 +0000 (09:13 +0000)
* expr.c (build_java_arrayaccess): Use convert to change
len's type.

From-SVN: r86307

gcc/java/ChangeLog
gcc/java/expr.c

index b16f9f3525286aed4eb8d8449991baed8258b16e..5af0be7ecec0ea5f48aff3b36e13179e3e5398ff 100644 (file)
@@ -1,3 +1,8 @@
+2004-08-20  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * expr.c (build_java_arrayaccess): Use convert to change
+       len's type.
+
 2004-08-19  Bryce McKinlay  <mckinlay@redhat.com>
 
        * class.c (make_local_function_alias): Allocate extra space for 'L'
        properly initialize `finished_label'. Don't emit gotos for empty
        try statements.
 
-2000-03-19  Martin v. Löwis  <loewis@informatik.hu-berlin.de>
+2000-03-19  Martin v. Löwis  <loewis@informatik.hu-berlin.de>
 
        * except.c (emit_handlers): Clear catch_clauses_last.
 
index 9472794dfee0aee97c334b37b1525f555551d232..97f540aac16dfc6ef51150ddd0f8d84f740e6655 100644 (file)
@@ -763,8 +763,8 @@ build_java_arrayaccess (tree array, tree type, tree index)
        * Note this is equivalent to and more efficient than:
        * INDEX < 0 || INDEX >= LEN && throw ... */
       tree test;
-      tree len = build_java_array_length_access (array);
-      TREE_TYPE (len) = unsigned_int_type_node;
+      tree len = convert (unsigned_int_type_node,
+                         build_java_array_length_access (array));
       test = fold (build2 (GE_EXPR, boolean_type_node, 
                           convert (unsigned_int_type_node, index),
                           len));