]> git.saurik.com Git - bison.git/commitdiff
* src/scan-gram.l: Be robust to BRACED_CODE appearing before any
authorAkim Demaille <akim@epita.fr>
Mon, 3 Apr 2006 13:50:10 +0000 (13:50 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 3 Apr 2006 13:50:10 +0000 (13:50 +0000)
rule.
Reported by Mickael Labau.
* tests/input.at (Torturing the Scanner): Test it.

ChangeLog
THANKS
src/scan-gram.l
tests/input.at

index 8215a9d1d8dccdbf83cebbd6ac9336e3e967b5e0..0f6abc1b8f85d16b265eeace0c2a140176760dcf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-04-03  Akim Demaille  <akim@lrde.epita.fr>
+
+       * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
+       rule.
+       Reported by Mickael Labau.
+       * tests/input.at (Torturing the Scanner): Test it.
+
 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
 
        * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
diff --git a/THANKS b/THANKS
index 4a5492e26d6ad756f3028e71937805f1bbd714be..0c795d7ff73196be62232508ffb6f03af772e9c7 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -45,6 +45,7 @@ Martin Mokrejs            mmokrejs@natur.cuni.cz
 Matt Kraai                kraai@alumni.cmu.edu
 Matt Rosing               rosing@peakfive.com
 Michael Hayes             m.hayes@elec.canterbury.ac.nz
+Mickael Labau             labau_m@epita.fr
 Mike Castle               dalgoda@ix.netcom.com
 Neil Booth                NeilB@earthling.net
 Nelson H. F. Beebe        beebe@math.utah.edu
index 1aa5e077e22290d89016d9922db4f1911fd907c8..cf704c7724e65c624392025547c9550116d7b805 100644 (file)
@@ -292,7 +292,7 @@ splice       (\\[ \f\t\v]*\n)*
 
   /* Code in between braces.  */
   "{" {
-    if (current_rule->action)
+    if (current_rule && current_rule->action)
       grammar_midrule_action ();
     STRING_GROW;
     token_type = BRACED_CODE;
index ba45119c2c9052c6aed884b613005405e730f4cc..82fbe06346c99c84d71deac1e2da506ff2f9f4f0 100644 (file)
@@ -204,6 +204,14 @@ AT_CHECK([bison input.y], [1], [],
 ]])
 
 
+AT_DATA([input.y], 
+[{}
+])
+AT_CHECK([bison input.y], [1], [],
+[[input.y:1.1-2: syntax error, unexpected {...}
+]])
+
+
 AT_DATA_GRAMMAR([input.y],
 [[%{
 /* This is seen in GCC: a %{ and %} in middle of a comment. */