ruby-changes:50329
From: nagachika <ko1@a...>
Date: Sat, 17 Feb 2018 01:41:01 +0900 (JST)
Subject: [ruby-changes:50329] nagachika:r62444 (ruby_2_4): merge revision(s) 57733, 57734: [Backport #13782]
nagachika 2018-02-17 01:40:57 +0900 (Sat, 17 Feb 2018) New Revision: 62444 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62444 Log: merge revision(s) 57733,57734: [Backport #13782] kwrest arg name * compile.c (iseq_set_arguments_keywords): make keyword rest argument name nd_vid consistently, regardless of whether other keyword arguments are present. [Fix GH-1529] * parse.y (new_args_tail_gen): ditto. fix nd_ainfo->kw_rest_arg [Fix GH-5129] Author: fate0 <fate0@u...> Modified directories: branches/ruby_2_4/ Modified files: branches/ruby_2_4/compile.c branches/ruby_2_4/node.c branches/ruby_2_4/parse.y branches/ruby_2_4/version.h Index: ruby_2_4/parse.y =================================================================== --- ruby_2_4/parse.y (revision 62443) +++ ruby_2_4/parse.y (revision 62444) @@ -10127,8 +10127,8 @@ new_args_tail_gen(struct parser_params * https://github.com/ruby/ruby/blob/trunk/ruby_2_4/parse.y#L10127 if (kr) arg_var(kr); if (b) arg_var(b); - args->kw_rest_arg = NEW_DVAR(kw_bits); - args->kw_rest_arg->nd_cflag = kr; + args->kw_rest_arg = NEW_DVAR(kr); + args->kw_rest_arg->nd_cflag = kw_bits; } else if (kr) { if (b) vtable_pop(lvtbl->args, 1); /* reorder */ Index: ruby_2_4/compile.c =================================================================== --- ruby_2_4/compile.c (revision 62443) +++ ruby_2_4/compile.c (revision 62444) @@ -1307,7 +1307,7 @@ iseq_set_arguments_keywords(rb_iseq_t *i https://github.com/ruby/ruby/blob/trunk/ruby_2_4/compile.c#L1307 iseq->body->param.flags.has_kw = TRUE; iseq->body->param.keyword = keyword = ZALLOC_N(struct rb_iseq_param_keyword, 1); - keyword->bits_start = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_vid); + keyword->bits_start = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_cflag); while (node) { NODE *val_node = node->nd_body->nd_value; @@ -1346,8 +1346,8 @@ iseq_set_arguments_keywords(rb_iseq_t *i https://github.com/ruby/ruby/blob/trunk/ruby_2_4/compile.c#L1346 keyword->num = kw; - if (args->kw_rest_arg->nd_cflag != 0) { - keyword->rest_start = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_cflag); + if (args->kw_rest_arg->nd_vid != 0) { + keyword->rest_start = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_vid); iseq->body->param.flags.has_kwrest = TRUE; } keyword->required_num = rkw; Index: ruby_2_4/node.c =================================================================== --- ruby_2_4/node.c (revision 62443) +++ ruby_2_4/node.c (revision 62444) @@ -961,8 +961,8 @@ dump_node(VALUE buf, VALUE indent, int c https://github.com/ruby/ruby/blob/trunk/ruby_2_4/node.c#L961 F_ID(nd_ainfo->rest_arg, "rest argument"); F_ID(nd_ainfo->block_arg, "block argument"); F_NODE(nd_ainfo->opt_args, "optional arguments"); - LAST_NODE; F_NODE(nd_ainfo->kw_args, "keyword arguments"); + LAST_NODE; F_NODE(nd_ainfo->kw_rest_arg, "keyword rest argument"); break; Index: ruby_2_4/version.h =================================================================== --- ruby_2_4/version.h (revision 62443) +++ ruby_2_4/version.h (revision 62444) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1 #define RUBY_VERSION "2.4.4" #define RUBY_RELEASE_DATE "2018-02-17" -#define RUBY_PATCHLEVEL 239 +#define RUBY_PATCHLEVEL 240 #define RUBY_RELEASE_YEAR 2018 #define RUBY_RELEASE_MONTH 2 Index: ruby_2_4 =================================================================== --- ruby_2_4 (revision 62443) +++ ruby_2_4 (revision 62444) Property changes on: ruby_2_4 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r57733-57734 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/