diff options
author | Jeremy Evans <[email protected]> | 2023-10-30 11:52:02 -0700 |
---|---|---|
committer | Jeremy Evans <[email protected]> | 2023-11-18 09:44:42 -0800 |
commit | ae48d4ad2ef7abbf116ff28b2cd3748d4c654d80 (patch) | |
tree | 9026c68368de1ba67d116fa7b2b3e977b1725f30 /vm_args.c | |
parent | c56dd94db0001b900a2dab3ee350a182d6bb42af (diff) |
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.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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); |