summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y19
1 files changed, 15 insertions, 4 deletions
diff --git a/parse.y b/parse.y
index 8451eb17d5e..78e66ee2409 100644
--- a/parse.y
+++ b/parse.y
@@ -8892,13 +8892,10 @@ dyna_push_gen(struct parser_params *parser)
}
static void
-dyna_pop_gen(struct parser_params *parser, const struct vtable *lvargs)
+dyna_pop_1(struct parser_params *parser)
{
struct vtable *tmp;
- while (lvtbl->args != lvargs) {
- local_pop();
- }
tmp = lvtbl->args;
lvtbl->args = lvtbl->args->prev;
vtable_free(tmp);
@@ -8907,6 +8904,20 @@ dyna_pop_gen(struct parser_params *parser, const struct vtable *lvargs)
vtable_free(tmp);
}
+static void
+dyna_pop_gen(struct parser_params *parser, const struct vtable *lvargs)
+{
+ while (lvtbl->args != lvargs) {
+ dyna_pop_1(parser);
+ if (!lvtbl->args) {
+ struct local_vars *local = lvtbl->prev;
+ xfree(lvtbl);
+ lvtbl = local;
+ }
+ }
+ dyna_pop_1(parser);
+}
+
static int
dyna_in_block_gen(struct parser_params *parser)
{