aboutsummaryrefslogtreecommitdiffstats
path: root/vm_args.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2023-10-30 11:52:02 -0700
committerJeremy Evans <code@jeremyevans.net>2023-11-18 09:44:42 -0800
commitae48d4ad2ef7abbf116ff28b2cd3748d4c654d80 (patch)
tree9026c68368de1ba67d116fa7b2b3e977b1725f30 /vm_args.c
parentc56dd94db0001b900a2dab3ee350a182d6bb42af (diff)
downloadruby-ae48d4ad2ef7abbf116ff28b2cd3748d4c654d80.tar.gz
Ensure keyword splat method argument is hash
Commit e87d0882910001ef3b0c2ccd43bf00cee8c34a0c introduced a regression where the keyword splat object passed by the caller would be directly used by callee as keyword splat parameters, if it implemented #to_hash. The return value of #to_hash would be ignored in this case.
Diffstat (limited to 'vm_args.c')
-rw-r--r--vm_args.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/vm_args.c b/vm_args.c
index 882966e432..3305b9bd33 100644
--- a/vm_args.c
+++ b/vm_args.c
@@ -549,6 +549,8 @@ setup_parameters_complex(rb_execution_context_t * const ec, const rb_iseq_t * co
converted_keyword_hash = check_kwrestarg(converted_keyword_hash, &kw_flag);
rb_ary_push(args->rest, converted_keyword_hash);
keyword_hash = Qnil;
+ } else {
+ keyword_hash = converted_keyword_hash;
}
int len = RARRAY_LENINT(args->rest);