mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
When splitting a keyword hash, dup it first to not mutate it
This commit is contained in:
parent
5c507db467
commit
16cd0de6ec
Notes:
git
2019-08-31 04:40:14 +09:00
1 changed files with 1 additions and 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;
|
*kw_hash_ptr = Qnil;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
case KW_HASH_HAS_BOTH_KEYS:
|
case KW_HASH_HAS_BOTH_KEYS:
|
||||||
|
*rest_hash_ptr = rb_hash_dup(*rest_hash_ptr);
|
||||||
keyword_hash_split(kw_hash_ptr, rest_hash_ptr);
|
keyword_hash_split(kw_hash_ptr, rest_hash_ptr);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue