diff options
author | Jeremy Evans <code@jeremyevans.net> | 2019-08-30 23:50:50 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2019-08-30 23:50:50 -0700 |
commit | 1f18b578ce300a3ba71a9525e680037122bb81d3 (patch) | |
tree | 49265f5fdb8ade2db3b8bb56719907fb8122b090 /vm_insnhelper.c | |
parent | 4868ad7e5b3065f9d94cc7e70889c9d31ebe88cc (diff) |
Don't pass an empty keyword hash when double splatting empty hash
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 6 |
1 files changed, 6 insertions, 0 deletions
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 && |