Patch: PR 8003

Andrew Haley aph@redhat.com
Tue Oct 8 06:29:00 GMT 2002


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.



More information about the Java-patches mailing list