summaryrefslogtreecommitdiff
path: root/vm_args.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2024-01-14 11:41:02 -0800
committerGitHub <noreply@github.com>2024-01-14 11:41:02 -0800
commit5c823aa686a5549649df4af86d173bebed2418e1 (patch)
tree7044e21e631b6cb1557ef9aa42ac9b9b4d850898 /vm_args.c
parent772413245f782f538413a69a270ec75ee8b77f18 (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_args.c')
-rw-r--r--vm_args.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/vm_args.c b/vm_args.c
index eda46aa92c..37b765a41d 100644
--- a/vm_args.c
+++ b/vm_args.c
@@ -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);
}