diff options
author | Jeremy Evans <code@jeremyevans.net> | 2019-08-17 22:47:43 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2019-08-30 12:39:31 -0700 |
commit | 16cd0de6ec8464129041c52174f5608e32512ca1 (patch) | |
tree | 1105dbfcf45817a861ce03aeb4f9ffb25392d0d4 /vm_args.c | |
parent | 5c507db467f20a6981ce6b282a607d4d975bcb07 (diff) | |
download | ruby-16cd0de6ec8464129041c52174f5608e32512ca1.tar.gz |
When splitting a keyword hash, dup it first to not mutate it
Diffstat (limited to 'vm_args.c')
-rw-r--r-- | vm_args.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -241,6 +241,7 @@ keyword_hash_p(VALUE *kw_hash_ptr, VALUE *rest_hash_ptr, int check_only_symbol) *kw_hash_ptr = Qnil; return FALSE; case KW_HASH_HAS_BOTH_KEYS: + *rest_hash_ptr = rb_hash_dup(*rest_hash_ptr); keyword_hash_split(kw_hash_ptr, rest_hash_ptr); return TRUE; } |