summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--bootstraptest/test_syntax.rb7
-rw-r--r--parse.y19
3 files changed, 26 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index d0fcab6987e..276e253cadb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Dec 10 01:12:55 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (dyna_pop_gen): pop dvars. [ruby-dev:39861]
+
Thu Dec 10 00:46:43 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* node.c (dump_node): fixed for long members.
diff --git a/bootstraptest/test_syntax.rb b/bootstraptest/test_syntax.rb
index 2e8639b3f49..619a4cbdb16 100644
--- a/bootstraptest/test_syntax.rb
+++ b/bootstraptest/test_syntax.rb
@@ -877,3 +877,10 @@ assert_normal_exit %q{
end
end
}, bug2415
+
+assert_normal_exit %q{
+ a {
+ b {|c.d| }
+ e
+ }
+}, '[ruby-dev:39861]'
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)
{