diff --git a/ChangeLog b/ChangeLog index 7e6692d27e..29a284a379 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,12 @@ Sat Aug 5 22:53:41 2006 K.Kosako * regparse.c: ditto. +Sat Aug 5 17:07:43 2006 Yukihiro Matsumoto + + * parse.y (top_local_setup): local_vars[-1] should point + ruby_scope itself to protect local_tbl from garbage collection. + [ruby-dev:29049] + Sat Aug 5 13:49:43 2006 Tadayoshi Funaba * lib/date/format.rb (str[fp]time): "%\n" means "\n". diff --git a/parse.y b/parse.y index c2d796eaf7..e0b82f8dfb 100644 --- a/parse.y +++ b/parse.y @@ -8066,7 +8066,7 @@ top_local_setup_gen(struct parser_params *parser) rb_mem_clear(vars+i, len-i); } else { - *vars++ = 0; + *vars++ = (VALUE)ruby_scope; rb_mem_clear(vars, len); } ruby_scope->local_vars = vars; @@ -8081,7 +8081,6 @@ top_local_setup_gen(struct parser_params *parser) if (ruby_scope->local_tbl && ruby_scope->local_vars[-1] == 0) { xfree(ruby_scope->local_tbl); } - ruby_scope->local_vars[-1] = 0; ruby_scope->local_tbl = local_tbl(); } }