This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: java/5794: gcj fails to verify .class file generated by Sun JDK1.4 compiler
- From: Andrew Haley <aph at cambridge dot redhat dot com>
- To: Per Bothner <per at bothner dot com>
- Cc: Jesse Rosenstock <jmr at ugcs dot caltech dot edu>, java-patches at gcc dot gnu dot org
- Date: Wed, 11 Sep 2002 20:31:25 +0100 (BST)
- Subject: Re: java/5794: gcj fails to verify .class file generated by Sun JDK1.4 compiler
- References: <20020904194416.86E5A84063@euro.ugcs.caltech.edu><3D7F9430.1030606@bothner.com>
Per Bothner writes:
> Jesse Rosenstock wrote:
>
> > In case the patch is ok, a ChangeLog entry:
> >
> > 2002-09-03 Jesse Rosenstock <jmr@ugcs.caltech.edu>
> >
> > For PR java/5794:
> > * verify.c (verify_jvm_instructions): Don't require that the
> > exception handler target doesn't overlap the range it's guarding.
> > For OPCODE_jsr, only push the return label if a ret instruction
> > for the jsr has been reached.
>
> Could you split up the patch, and check them in separately? (You don't
> need to re-run the testsuite separately.)
>
> --- verify.c 4 Jun 2002 20:32:08 -0000 1.48
> +++ verify.c 4 Sep 2002 19:19:23 -0000
> @@ -470,9 +470,8 @@
>
> if (start_pc < 0 || start_pc >= length
> || end_pc < 0 || end_pc > length || start_pc >= end_pc
> || handler_pc < 0 || handler_pc >= length
> - || (handler_pc >= start_pc && handler_pc < end_pc)
> || ! (instruction_bits [start_pc] & BCODE_INSTRUCTION_START)
> || (end_pc < length &&
> ! (instruction_bits [end_pc] & BCODE_INSTRUCTION_START))
> || ! (instruction_bits [handler_pc] & BCODE_INSTRUCTION_START))
>
> I'm still not really comfortable with this. I'm be happier with a
> warning, at least until I get a better explaination of why the bytecode
> makes sense.
Ah, I already changed that case to a warning because a fair bit of
case was not being compiled. I posted the patch and eventually
checked it in as "obvious", which I thought it was. Looks like I
shouldn't have done so; mea culpa.
Andrew.