OSDN Git Service

Fix for PR java/5942:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Mar 2002 18:59:04 +0000 (18:59 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Mar 2002 18:59:04 +0000 (18:59 +0000)
* parse.y (init_src_parse): Added sanity check.
* parse.h (struct parser_ctxt) [modifier_ctx]: Array has 12
elements, not 11.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51398 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/java/ChangeLog
gcc/java/parse.h
gcc/java/parse.y

index 1605e21..8549fcb 100644 (file)
@@ -1,3 +1,10 @@
+2002-03-26  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.
+
 2002-03-26  Neil Booth  <neil@daikokuya.demon.co.uk>
 
        * decl.c (lang_mark_tree): Rename java_mark_tree.
index 1d8bb05..ded6a70 100644 (file)
@@ -762,7 +762,7 @@ struct parser_ctxt {
 
   /* 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 8cb595e..e8ef2ef 100644 (file)
@@ -16013,6 +16013,10 @@ init_src_parse ()
 {
   /* 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 ();
 }
 
 \f