This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: PR 5942


>>>>> "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 ();
 }
 
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]