diff options
author | Jeremy Evans <code@jeremyevans.net> | 2023-11-21 09:02:31 -0800 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2023-12-07 11:27:55 -0800 |
commit | 13cd963500106b366c8df9eec5c1b6815e93f07f (patch) | |
tree | 40b919fb6153ecfb2da0fc52176659f725874596 /node.h | |
parent | aa808204bb3b84ad37e2c4722f9d00e07ab8f281 (diff) | |
download | ruby-13cd963500106b366c8df9eec5c1b6815e93f07f.tar.gz |
Prevent modification of splat array inside setup_parameters_complex
For the following:
```
def f(*a); a end
p f(*a, kw: 3)
```
`setup_parameters_complex` pushes `{kw: 3}` onto `a`. This worked fine
back when `concatarray true` was used and `a` was already a copy. It
does not work correctly with the optimization to switch to
`concatarray false`. This duplicates the array on the callee side
in such a case.
This affects cases when passing a regular splat and a keyword splat
(or literal keywords) in a method call, where the method does not
accept keywords.
This allocation could probably be avoided, but doing so would
make `setup_parameters_complex` more complicated.
Diffstat (limited to 'node.h')
0 files changed, 0 insertions, 0 deletions