summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Kiefer <kiefer@dfki.de>2011-02-19 19:24:07 -0500
committerJoel E. Denny <joeldenny@joeldenny.org>2011-02-19 19:57:42 -0500
commitaa3bcdf35e6e0daab858e528cfd84042a962bb0c (patch)
tree6e8872f385e518e8fe4120010907c9fc348f7248
parent84072495292eb90d6683fbabe159bf8900193810 (diff)
downloadbison-aa3bcdf35e6e0daab858e528cfd84042a962bb0c.tar.gz
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. (cherry picked from commit 8db68289d1162b763606fe5271a7529408224d38)
-rw-r--r--ChangeLog9
-rw-r--r--THANKS1
-rw-r--r--data/lalr1.java2
3 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 3a6e81e0..10839eec 100644
--- 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 30a9d42d..e13924aa 100644
--- 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
diff --git a/data/lalr1.java b/data/lalr1.java
index a6829d3f..309fc956 100644
--- a/data/lalr1.java
+++ b/data/lalr1.java
@@ -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);
}]])[