From b43afa0a8f82a5d806adc24afa2eaf41479da1a3 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Fri, 4 Oct 2019 01:48:31 +0900 Subject: Make parser_params have parent_iseq instead of base_block The parser needs to determine whether a local varaiable is defined or not in outer scope. For the sake, "base_block" field has kept the outer block. However, the whole block was actually unneeded; the parser used only base_block->iseq. So, this change lets parser_params have the iseq directly, instead of the whole block. --- vm_eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vm_eval.c') diff --git a/vm_eval.c b/vm_eval.c index 1c205f0a30..07af3b4b58 100644 --- a/vm_eval.c +++ b/vm_eval.c @@ -1579,7 +1579,7 @@ eval_make_iseq(VALUE src, VALUE fname, int line, const rb_binding_t *bind, fname = rb_fstring_lit("(eval)"); } - rb_parser_set_context(parser, base_block, FALSE); + rb_parser_set_context(parser, parent, FALSE); ast = rb_parser_compile_string_path(parser, fname, src, line); if (ast->body.root) { iseq = rb_iseq_new_with_opt(&ast->body, -- cgit v1.2.1