This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: PR 8003
- From: Andrew Haley <aph at redhat dot com>
- To: tromey at redhat dot com
- Cc: Java Patch List <java-patches at gcc dot gnu dot org>,Gcc Patch List <gcc-patches at gcc dot gnu dot org>,Per Bothner <bothner at bothner dot com>
- Date: Tue, 8 Oct 2002 14:30:44 +0100 (BST)
- Subject: Patch: PR 8003
- References: <87n0q944rz.fsf@fleche.redhat.com>
Tom Tromey writes:
> This patch fixes PR 8003.
>
> In this PR, a syntax error causes gcj to SEGV. It happens because
> when trying to give a nicer error message, we reference `java_lval' in
> an invalid way -- we use the incorrect field. (java_lval is a union,
> and the `node' field is not always valid. That is what happens in
> this case.)
>
> I tried fixing this a different way. I added a new
> variable_declarator_id rule which matched (at the end)
> `OSB_TK expression error'. This let us continue to print the "can't
> specify array dimension" error. However, this has the side effect of
> giving a different error if an invalid expression is used after the
> `['. It seems weird to give such an error if, after fixing the
> expression, the result is still invalid.
>
> Based on this, I chose the simpler, but somewhat less friendly,
> approach of simply emitting the "missing ]" error in all cases.
>
> Ok to commit?
If no test regressions, yes.
Andrew.