From c4697991264e473ac8295eea04de1d1ac04bec2f Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Wed, 31 Jan 2024 11:07:45 -0800 Subject: Do not modify provided argument splat when using ruby2_keywords with anonymous splat Previously, this would push the provided keywords onto the argument splat. Add ruby2_keywords to the list of other checks for whether it is safe for treating a given splat as mutable when the called method accepts an anonymous splat. --- vm_args.c | 1 + 1 file changed, 1 insertion(+) (limited to 'vm_args.c') diff --git a/vm_args.c b/vm_args.c index e7043ac897..aa8c2ec299 100644 --- a/vm_args.c +++ b/vm_args.c @@ -518,6 +518,7 @@ setup_parameters_complex(rb_execution_context_t * const ec, const rb_iseq_t * co given_argc == ISEQ_BODY(iseq)->param.lead_num + (kw_flag ? 2 : 1) && !ISEQ_BODY(iseq)->param.flags.has_opt && !ISEQ_BODY(iseq)->param.flags.has_post && + !ISEQ_BODY(iseq)->param.flags.ruby2_keywords && (!kw_flag || !ISEQ_BODY(iseq)->param.flags.has_kw || !ISEQ_BODY(iseq)->param.flags.has_kwrest || -- cgit v1.2.3