diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-02-27 13:52:07 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-02-27 13:52:07 +0000 |
commit | 9b1f2b073ff1fc3ce8fbb39c64db92e302069436 (patch) | |
tree | ae4a1ae667a7c005c3c1f548718fef6ecf24ff3d /compile.c | |
parent | e32c5b6faa608ea75a2879fb2da9d739c94bcb3c (diff) | |
download | ruby-9b1f2b073ff1fc3ce8fbb39c64db92e302069436.tar.gz |
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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1307,7 +1307,7 @@ iseq_set_arguments_keywords(rb_iseq_t *iseq, LINK_ANCHOR *const optargs, 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 *iseq, LINK_ANCHOR *const optargs, 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; |