]> git.saurik.com Git - bison.git/commitdiff
java: fix reduction traces.
authorAkim Demaille <demaille@gostai.com>
Sun, 15 Jan 2012 13:23:15 +0000 (14:23 +0100)
committerAkim Demaille <demaille@gostai.com>
Sun, 15 Jan 2012 13:24:07 +0000 (14:24 +0100)
* data/lalr1.java (yy_reduce_print): Fix state index.
Reported by Tim Landscheidt.

ChangeLog
data/lalr1.java

index 70f113f239d03b5aa7e2c72297dbc55ad7b21b40..faa7e18639cfdc4d2bdd66001af11620077ff4f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-01-15  Akim Demaille  <demaille@gostai.com>
+
+       java: fix reduction traces.
+       * data/lalr1.java (yy_reduce_print): Fix state index.
+       Reported by Tim Landscheidt.
+
 2012-01-12  Jim Meyering  <meyering@redhat.com>
 
        build: avoid warning from coverity about lbitset_elt_find
index 43e9b9705c694fc7f5ef0c748c0b45b44f7f062c..57ff9932f93086a152d23edc34287424747df61f 100644 (file)
@@ -848,7 +848,7 @@ m4_popdef([b4_at_dollar])])dnl
     /* The symbols being reduced.  */
     for (int yyi = 0; yyi < yynrhs; yyi++)
       yy_symbol_print ("   $" + (yyi + 1) + " =",
-                       yystos_[yystack.stateAt(yyi + 1 - yynrhs)],
+                       yystos_[yystack.stateAt(yynrhs - (yyi + 1))],
                        ]b4_rhs_value(yynrhs, yyi + 1)b4_locations_if([,
                        b4_rhs_location(yynrhs, yyi + 1)])[);
   }