mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
java: finish fixing parser stack popping bug.
* NEWS (2.5): Document.
* data/lalr1.java (YYParser::YYStack::pop): Fix off-by-one error
in clearing the location stack. Also fix pop function that
accepts no arguments.
(cherry picked from commit 4c2a6e42ba)
Conflicts:
data/lalr1.java
This commit is contained in:
@@ -297,14 +297,14 @@ b4_lexer_if([[
|
||||
}
|
||||
|
||||
public final void pop () {
|
||||
height--;
|
||||
pop (1);
|
||||
}
|
||||
|
||||
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 + 1, null);
|
||||
]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height, null);]])[
|
||||
]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height + 1, null);]])[
|
||||
}
|
||||
height -= num;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user