diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2021-04-23 22:17:20 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-23 22:17:20 -0400 |
commit | dee58d7ae7b75971f349f2217007fdf45d1ea23d (patch) | |
tree | 6db23164155aff03bc56f5fa36af02cd82899809 /vm_insnhelper.c | |
parent | 1f2b5c6dfe86e8ea2bbcd9a70d7a129da7e64a4a (diff) |
Add back checks for empty kw splat with tests (#4405)
This reverts commit a224ce8150f2bc687cf79eb415c931d87a4cd247.
Turns out the checks are needed to handle splatting an array with an
empty ruby2 keywords hash.
Notes
Notes:
Merged-By: XrXr
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 7c715c9a33..840bd490b6 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -2412,6 +2412,7 @@ vm_callee_setup_arg(rb_execution_context_t *ec, struct rb_calling_info *calling, if (LIKELY(rb_simple_iseq_p(iseq))) { rb_control_frame_t *cfp = ec->cfp; CALLER_SETUP_ARG(cfp, calling, ci); + CALLER_REMOVE_EMPTY_KW_SPLAT(cfp, calling, ci); if (calling->argc != iseq->body->param.lead_num) { argument_arity_error(ec, iseq, calling->argc, iseq->body->param.lead_num, iseq->body->param.lead_num); @@ -2425,6 +2426,7 @@ vm_callee_setup_arg(rb_execution_context_t *ec, struct rb_calling_info *calling, else if (rb_iseq_only_optparam_p(iseq)) { rb_control_frame_t *cfp = ec->cfp; CALLER_SETUP_ARG(cfp, calling, ci); + CALLER_REMOVE_EMPTY_KW_SPLAT(cfp, calling, ci); const int lead_num = iseq->body->param.lead_num; const int opt_num = iseq->body->param.opt_num; |