From 665589cbdf7bf652067113dd1c0bc49012b990e0 Mon Sep 17 00:00:00 2001 From: nagachika Date: Tue, 29 Sep 2020 20:33:06 +0900 Subject: merge revision(s) df14c758fc705c49c2aaf4c9276a8f7229438fbf: [Backport #17181] Make hash returned by Hash#transform_values not have a default This sets an explicit default of nil. There is probably a better approach of removing the default. Fixes [Bug #17181] --- hash.c | 1 + 1 file changed, 1 insertion(+) (limited to 'hash.c') diff --git a/hash.c b/hash.c index 4a3f2ff536..63b228f501 100644 --- a/hash.c +++ b/hash.c @@ -3211,6 +3211,7 @@ rb_hash_transform_values(VALUE hash) RETURN_SIZED_ENUMERATOR(hash, 0, 0, hash_enum_size); result = hash_copy(hash_alloc(rb_cHash), hash); + SET_DEFAULT(result, Qnil); if (!RHASH_EMPTY_P(hash)) { rb_hash_stlike_foreach_with_replace(result, transform_values_foreach_func, transform_values_foreach_replace, result); -- cgit v1.2.3