This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Java: fix to array store operation



I checked in this patch to loosen the condition on which
ArrayStoreException can be raised at runtime. As a side effect, it
also fixes some minor indentation problems.

./A

Tue Nov 30 12:28:34 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>

        * jcf-write.c (generate_byecode_insns): Fixed indentation for
        COMPOUND_EXPR and FIX_TRUNC_EXPR cases.

        * parse.y (patch_assignment): Removed bogus final class test on
        lhs when checking on whether to emit an ArrayStoreException runtime
        check.
        * expr.c (expand_java_arraystore): Likewise. 

Index: jcf-write.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/jcf-write.c,v
retrieving revision 1.38
diff -u -p -r1.38 jcf-write.c
--- jcf-write.c	1999/10/13 23:19:33	1.38
+++ jcf-write.c	1999/12/02 19:27:59
@@ -1462,8 +1462,8 @@ generate_bytecode_insns (exp, target, st
 	}
       break;
       case COMPOUND_EXPR:	
-	generate_bytecode_insns (TREE_OPERAND (exp, 0), IGNORE_TARGET, state);
-	generate_bytecode_insns (TREE_OPERAND (exp, 1), target, state);
+      generate_bytecode_insns (TREE_OPERAND (exp, 0), IGNORE_TARGET, state);
+      generate_bytecode_insns (TREE_OPERAND (exp, 1), target, state);
       break;
     case EXPR_WITH_FILE_LOCATION:
       {
@@ -2140,7 +2140,8 @@ generate_bytecode_insns (exp, target, st
 	  {
 	    if (TREE_CODE (exp) == CONVERT_EXPR)
 	      {
-		int index = find_class_constant (&state->cpool, TREE_TYPE (dst_type));
+		int index = find_class_constant (&state->cpool, 
+						 TREE_TYPE (dst_type));
 		RESERVE (3);
 		OP1 (OPCODE_checkcast);
 		OP2 (index);
Index: parse.y
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/parse.y,v
retrieving revision 1.121
diff -u -p -r1.121 parse.y
--- parse.y	1999/12/01 13:06:10	1.121
+++ parse.y	1999/12/02 19:27:59
@@ -9193,8 +9193,7 @@ patch_assignment (node, wfl_op1, wfl_op2
   if (!flag_emit_class_files
       && !flag_emit_xref
       && lvalue_from_array 
-      && JREFERENCE_TYPE_P (TYPE_ARRAY_ELEMENT (lhs_type))
-      && !CLASS_FINAL (TYPE_NAME (GET_SKIP_TYPE (rhs_type))))
+      && JREFERENCE_TYPE_P (TYPE_ARRAY_ELEMENT (lhs_type)))
     {
       tree check;
       tree base = lvalue;
Index: expr.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/expr.c,v
retrieving revision 1.48
diff -u -p -r1.48 expr.c
--- expr.c	1999/09/02 21:57:08	1.48
+++ expr.c	1999/12/02 19:27:59
@@ -874,8 +874,7 @@ expand_java_arraystore (rhs_type_node)
   index = save_expr (index);
   array = save_expr (array);
 
-  if (TREE_CODE (rhs_type_node) == POINTER_TYPE
-      && !CLASS_FINAL (TYPE_NAME (TREE_TYPE (rhs_type_node))))
+  if (TREE_CODE (rhs_type_node) == POINTER_TYPE)
     {
       tree check = build (CALL_EXPR, void_type_node,
 			  build_address_of (soft_checkarraystore_node),


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]