summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngelo Borsotti <angelo.borsotti@gmail.com>2011-03-06 22:19:18 -0500
committerJoel E. Denny <jdenny@clemson.edu>2011-03-06 23:04:55 -0500
commit6f75992be50b83a084f955f63e5c35ccc8705f08 (patch)
tree4fdf2f37ae7320b407f71e9de90050617998004d
parent121c498280f96b31a1f90e2012751509e6358a64 (diff)
downloadbison-6f75992be50b83a084f955f63e5c35ccc8705f08.tar.gz
java: fix parser stack popping bug.
Reported at <http://lists.gnu.org/archive/html/bug-bison/2011-02/msg00005.html>. * THANKS (Angelo Borsotti): Add. * data/lalr1.java (YYParser::YYStack::pop): Fix off-by-one error in clearing the value stack. Previously, the top element of the stack wasn't cleared and so the value was not garbage collected.
-rw-r--r--ChangeLog10
-rw-r--r--THANKS1
-rw-r--r--data/lalr1.java2
3 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 69efad5b..6331311a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-03-06 Angelo Borsotti <angelo.borsotti@gmail.com> (tiny change)
+
+ java: fix parser stack popping bug.
+ Reported at
+ <http://lists.gnu.org/archive/html/bug-bison/2011-02/msg00005.html>.
+ * THANKS (Angelo Borsotti): Add.
+ * data/lalr1.java (YYParser::YYStack::pop): Fix off-by-one error
+ in clearing the value stack. Previously, the top element of the
+ stack wasn't cleared and so the value was not garbage collected.
+
2011-03-06 Joel E. Denny <joeldenny@joeldenny.org>
doc: cite publication for LAC.
diff --git a/THANKS b/THANKS
index 43acbed2..ac6047a4 100644
--- a/THANKS
+++ b/THANKS
@@ -8,6 +8,7 @@ Alexander Belopolsky alexb@rentec.com
Alexandre Duret-Lutz adl@src.lip6.fr
Andreas Schwab schwab@suse.de
Andrew Suffield asuffield@users.sourceforge.net
+Angelo Borsotti angelo.borsotti@gmail.com
Anthony Heading ajrh@ajrh.net
Arnold Robbins arnold@skeeve.com
Art Haas ahaas@neosoft.com
diff --git a/data/lalr1.java b/data/lalr1.java
index aad54a33..29005c28 100644
--- a/data/lalr1.java
+++ b/data/lalr1.java
@@ -261,7 +261,7 @@ b4_lexer_if([[
public final void pop (int num) {
// Avoid memory leaks... garbage collection is a white lie!
if (num > 0) {
- java.util.Arrays.fill (valueStack, height - num + 1, height, null);
+ java.util.Arrays.fill (valueStack, height - num + 1, height + 1, null);
]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height, null);]])[
}
height -= num;