diff options
author | Jeremy Evans <code@jeremyevans.net> | 2024-01-14 11:41:02 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-14 11:41:02 -0800 |
commit | 5c823aa686a5549649df4af86d173bebed2418e1 (patch) | |
tree | 7044e21e631b6cb1557ef9aa42ac9b9b4d850898 /vm.c | |
parent | 772413245f782f538413a69a270ec75ee8b77f18 (diff) |
Support keyword splatting nil
nil is treated similarly to the empty hash in this case, passing
no keywords and not calling any conversion methods.
Fixes [Bug #20064]
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -3666,7 +3666,9 @@ kwmerge_i(VALUE key, VALUE value, VALUE hash) static VALUE m_core_hash_merge_kwd(VALUE recv, VALUE hash, VALUE kw) { - REWIND_CFP(hash = core_hash_merge_kwd(hash, kw)); + if (!NIL_P(kw)) { + REWIND_CFP(hash = core_hash_merge_kwd(hash, kw)); + } return hash; } |