diff options
author | Jeremy Evans <[email protected]> | 2024-01-31 11:07:45 -0800 |
---|---|---|
committer | Jeremy Evans <[email protected]> | 2024-01-31 12:44:38 -0800 |
commit | c4697991264e473ac8295eea04de1d1ac04bec2f (patch) | |
tree | 430bc53bef21d11f2ccfa5abe13a7bba60666855 /vm_args.c | |
parent | 71f16d498d30b3528774f519a0939eae59ef7602 (diff) |
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.
Diffstat (limited to 'vm_args.c')
-rw-r--r-- | vm_args.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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 || |