[前][次][番号順一覧][スレッド一覧]

ruby-changes:65672

From: Nobuyoshi <ko1@a...>
Date: Sun, 28 Mar 2021 09:48:57 +0900 (JST)
Subject: [ruby-changes:65672] 5e5fb72f99 (master): Clear an intermediate hash [Bug #17735]

https://git.ruby-lang.org/ruby.git/commit/?id=5e5fb72f99

From 5e5fb72f99701dc27c66ab148471893f14e6d6f0 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sun, 28 Mar 2021 09:42:26 +0900
Subject: Clear an intermediate hash [Bug #17735]

---
 hash.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hash.c b/hash.c
index d6d3752..00beadf 100644
--- a/hash.c
+++ b/hash.c
@@ -3292,6 +3292,7 @@ rb_hash_transform_keys_bang(int argc, VALUE *argv, VALUE hash) https://github.com/ruby/ruby/blob/trunk/hash.c#L3292
             rb_hash_aset(hash, new_key, val);
             rb_hash_aset(new_keys, new_key, Qnil);
         }
+        rb_hash_clear(new_keys);
     }
     return hash;
 }
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]