summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-07-15 21:25:43 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-08-03 10:56:50 +0900
commit4c3140d60f6f94504842a4d0c0d79752a87aec8d (patch)
treece3764fc7224b08da01186541550e98d1aaf7cdc /iseq.c
parent731315bf5520a9ca7c94338c13d10c15b00c78c7 (diff)
Add keyrest to ruby2_keywords parameters [Bug #18011]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4705
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/iseq.c b/iseq.c
index 47bc108d3e..b08f1bb497 100644
--- a/iseq.c
+++ b/iseq.c
@@ -3116,9 +3116,18 @@ rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
rb_ary_push(args, a);
}
}
- if (body->param.flags.has_kwrest) {
+ if (body->param.flags.has_kwrest || body->param.flags.ruby2_keywords) {
+ ID param;
CONST_ID(keyrest, "keyrest");
- rb_ary_push(args, PARAM(keyword->rest_start, keyrest));
+ PARAM_TYPE(keyrest);
+ if (body->param.flags.has_kwrest &&
+ rb_id2str(param = PARAM_ID(keyword->rest_start))) {
+ rb_ary_push(a, ID2SYM(param));
+ }
+ else if (body->param.flags.ruby2_keywords) {
+ rb_ary_push(a, ID2SYM(idPow));
+ }
+ rb_ary_push(args, a);
}
if (body->param.flags.has_block) {
CONST_ID(block, "block");