This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
RFA: Java anewarray typo
- To: java at gcc dot gnu dot org
- Subject: RFA: Java anewarray typo
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Sun, 09 Sep 2001 17:45:19 -0700
- Organization: CodeSourcery, LLC
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: