From 1f18b578ce300a3ba71a9525e680037122bb81d3 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Fri, 30 Aug 2019 23:50:50 -0700 Subject: Don't pass an empty keyword hash when double splatting empty hash --- vm_insnhelper.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'vm_insnhelper.c') diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 2e86a0d3a2..71c5930b2e 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -2912,6 +2912,12 @@ vm_callee_setup_block_arg(rb_execution_context_t *ec, struct rb_calling_info *ca CALLER_SETUP_ARG(cfp, calling, ci, 1); /* splat arg */ + if (UNLIKELY(IS_ARGS_KW_SPLAT(ci))) { + if (RHASH_EMPTY_P(argv[calling->argc-1])) { + calling->argc--; + } + } + if (arg_setup_type == arg_setup_block && calling->argc == 1 && iseq->body->param.flags.has_lead && -- cgit v1.2.3