diff options
author | Jeremy Evans <[email protected]> | 2024-01-14 11:41:02 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2024-01-14 11:41:02 -0800 |
commit | 5c823aa686a5549649df4af86d173bebed2418e1 (patch) | |
tree | 7044e21e631b6cb1557ef9aa42ac9b9b4d850898 /vm_args.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 <[email protected]>
Diffstat (limited to 'vm_args.c')
-rw-r--r-- | vm_args.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -434,6 +434,10 @@ fill_keys_values(st_data_t key, st_data_t val, st_data_t ptr) static inline int ignore_keyword_hash_p(VALUE keyword_hash, const rb_iseq_t * const iseq, unsigned int * kw_flag, VALUE * converted_keyword_hash) { + if (keyword_hash == Qnil) { + return 1; + } + if (!RB_TYPE_P(keyword_hash, T_HASH)) { keyword_hash = rb_to_hash_type(keyword_hash); } |