]> git.saurik.com Git - bison.git/commitdiff
java: fix location handling bug.
authorBernd Kiefer <kiefer@dfki.de>
Sun, 20 Feb 2011 00:24:07 +0000 (19:24 -0500)
committerJoel E. Denny <joeldenny@joeldenny.org>
Sun, 20 Feb 2011 00:57:42 +0000 (19:57 -0500)
Reported at
<http://lists.gnu.org/archive/html/bison-patches/2011-02/msg00005.html>.
* data/lalr1.java (YYParser::yylloc): For non-empty RHS, fix
reversed access to location stack.
* THANKS (Bernd Kiefer): Add.
(cherry picked from commit 8db68289d1162b763606fe5271a7529408224d38)

ChangeLog
THANKS
data/lalr1.java

index 3a6e81e03bf45d62b51c51abb6ae4db322888964..10839eec6491e3beed58f3bdbae8a836dc3de854 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-02-19  Bernd Kiefer  <kiefer@dfki.de>  (tiny change)
+
+       java: fix location handling bug.
+       Reported at
+       <http://lists.gnu.org/archive/html/bison-patches/2011-02/msg00005.html>.
+       * data/lalr1.java (YYParser::yylloc): For non-empty RHS, fix
+       reversed access to location stack.
+       * THANKS (Bernd Kiefer): Add.
+
 2011-02-13  Joel E. Denny  <joeldenny@joeldenny.org>
 
        doc: fix some minor inconsistencies.
diff --git a/THANKS b/THANKS
index 30a9d42d10b9389088d7adb621b5e8105230ef6b..e13924aa145d06b7c01c53c67794e5ff687562c6 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -13,6 +13,7 @@ Arnold Robbins            arnold@skeeve.com
 Art Haas                  ahaas@neosoft.com
 Baron Schwartz            baron@sequent.org
 Benoit Perrot             benoit.perrot@epita.fr
+Bernd Kiefer              kiefer@dfki.de
 Bert Deknuydt             Bert.Deknuydt@esat.kuleuven.ac.be
 Bill Allombert            Bill.Allombert@math.u-bordeaux1.fr
 Bob Rossi                 bob@brasko.net
index a6829d3fca935464cba9241967c6b44de92da7ab..309fc956869cfc1c88065c64628a88c6171a0edc 100644 (file)
@@ -120,7 +120,7 @@ b4_locations_if([[
   private ]b4_location_type[ yylloc (YYStack rhs, int n)
   {
     if (n > 0)
-      return new ]b4_location_type[ (rhs.locationAt (1).begin, rhs.locationAt (n).end);
+      return new ]b4_location_type[ (rhs.locationAt (n-1).begin, rhs.locationAt (0).end);
     else
       return new ]b4_location_type[ (rhs.locationAt (0).end);
   }]])[