This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


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

RFA: Java anewarray typo



I spent some time tracking down a problem where we generated incorrect
code for checking array accesses when processing byte codes.  This
is the fix.

I think this patch is an obvious fix.  Certainly, it does not make
sense to check the same condition twice!  The basic problem was that
we had:

  iconst_3
  anewarray <some class>

and we decided that the array had 2 -- not 3 -- elements thanks to
the creation of another array previously with:

  iconst_2
  newarray int

OK to install, assuming tests on i686-pc-linux-gnu succeed?

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

2001-09-09  Mark Mitchell  <mark@codesourcery.com>

	* verify.c (verify_jvm_instructions): Fix typo.

*** verify.c~	Sun Apr 29 04:26:30 2001
--- verify.c	Sun Sep  9 17:30:11 2001
*************** verify_jvm_instructions (jcf, byte_ops, 
*** 594,600 ****
  	  goto push_int;
  	push_int:
  	  if (byte_ops[PC] == OPCODE_newarray
! 	      || byte_ops[PC] == OPCODE_newarray)
  	    int_value = i;
  	  PUSH_TYPE (int_type_node);  break;
  	case OPCODE_lconst_0:	case OPCODE_lconst_1:
--- 594,600 ----
  	  goto push_int;
  	push_int:
  	  if (byte_ops[PC] == OPCODE_newarray
! 	      || byte_ops[PC] == OPCODE_anewarray)
  	    int_value = i;
  	  PUSH_TYPE (int_type_node);  break;
  	case OPCODE_lconst_0:	case OPCODE_lconst_1:


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