diff options
| author | Jeremy Evans <code@jeremyevans.net> | 2023-12-12 07:34:53 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-12 07:34:53 -0800 |
| commit | 2f1d6da8c45590bf3461ed4bf051a4e1009eaf85 (patch) | |
| tree | 8e868e9b6a71fe74c323dfa2e81422d08beadf6f /include/ruby/atomic.h | |
| parent | f671c5d1791d14a44902cfe672ae6b457d1592e9 (diff) | |
Fix op asgn calls with keywords
Examples of such calls:
```ruby
obj[kw: 1] += fo
obj[**kw] &&= bar
```
Before this patch, literal keywords would segfault in the compiler,
and keyword splat usage would result in TypeError.
This handles all cases I can think of:
* literal keywords
* keyword splats
* combined with positional arguments
* combined with regular splats
* both with and without blocks
* both popped and non-popped cases
This also makes sure that to_hash is only called once on the keyword
splat argument, instead of twice, and make sure it is called before
calling to_proc on a passed block.
Fixes [Bug #20051]
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Diffstat (limited to 'include/ruby/atomic.h')
0 files changed, 0 insertions, 0 deletions
