From 16cd0de6ec8464129041c52174f5608e32512ca1 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Sat, 17 Aug 2019 22:47:43 -0700 Subject: [PATCH] When splitting a keyword hash, dup it first to not mutate it --- vm_args.c | 1 + 1 file changed, 1 insertion(+) diff --git a/vm_args.c b/vm_args.c index a91db40cf9..69be10a2b6 100644 --- a/vm_args.c +++ b/vm_args.c @@ -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; }