re PR java/5942 (tree check failure when compiling Classpath with strictfp StrictMath...
authorTom Tromey <tromey@redhat.com>
Tue, 26 Mar 2002 18:59:04 +0000 (18:59 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Tue, 26 Mar 2002 18:59:04 +0000 (18:59 +0000)
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.

From-SVN: r51398

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

index 1605e212458d73bdbae3be77ee0460d6f742d206..8549fcb4a7f52e803de26d6fe576b2ea7e08bad4 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 1d8bb05ef0f9d52244dce0bfb0b94fc81d989821..ded6a7000cfa14751b993a12096074f3a1486546 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 8cb595e33d99f53d790b897673b1fd758ee3622c..e8ef2ef6b2b1a117dbd15a62154b5a219349b4d6 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