RFA: Java anewarray typo

Mark Mitchell mark@codesourcery.com
Sun Sep 9 17:45:00 GMT 2001


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:


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /