This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: PR 5942
- From: Tom Tromey <tromey at redhat dot com>
- To: apbianco 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>
- Date: 26 Mar 2002 12:32:39 -0700
- Subject: Re: Patch: PR 5942
- References: <87r8m73gm0.fsf@creche.redhat.com> <15520.44612.227046.203513@ryobi.cygnus.com>
- Reply-to: tromey at redhat dot com
>>>>> "Alex" == Alexandre Petit-Bianco <apbianco@cygnus.com> writes:
Tom> Alex, is this ok?
Alex> Yes, thank you.
I'm checking in a slightly different patch on the trunk.
There we seem to use ARRAY_SIZE, so I followed suit; patch appended.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
Fix for PR java/5942:
* parse.y (init_src_parse): Added sanity check.
* parse.h (struct parser_ctxt) [modifier_ctx]: Array has 12
elements, not 11.
Index: parse.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.h,v
retrieving revision 1.82
diff -u -r1.82 parse.h
--- parse.h 2002/02/18 04:55:07 1.82
+++ parse.h 2002/03/26 18:57:39
@@ -762,7 +762,7 @@
/* This section is defined only if we compile jc1 */
#ifndef JC1_LITE
- tree modifier_ctx [11]; /* WFL of modifiers */
+ tree modifier_ctx [12]; /* WFL of modifiers */
tree class_type; /* Current class */
tree function_decl; /* Current function decl, save/restore */
Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.363
diff -u -r1.363 parse.y
--- parse.y 2002/03/25 19:23:37 1.363
+++ parse.y 2002/03/26 18:57:51
@@ -16013,6 +16013,10 @@
{
/* Register roots with the garbage collector. */
ggc_add_tree_root (src_parse_roots, ARRAY_SIZE (src_parse_roots));
+
+ /* Sanity check; we've been bit by this before. */
+ if (ARRAY_SIZE (ctxp->modifier_ctx) != MODIFIER_TK - PUBLIC_TK)
+ abort ();
}