From 0504f8a199c525cf47037de8f5b25979665482cb Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 28 Sep 2002 04:21:31 +0000 Subject: * hash.c (rb_hash_become): should check self-assignment after conversion. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ hash.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a4b08b8d2..f0dd3a271 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Sep 28 13:19:29 2002 Nobuyoshi Nakada + + * hash.c (rb_hash_become): should check self-assignment after + conversion. + Sat Sep 28 10:40:44 2002 Yukihiro Matsumoto * hash.c (rb_hash_become): Hash#become should check added diff --git a/hash.c b/hash.c index 6e1c247ba..69ca1db4e 100644 --- a/hash.c +++ b/hash.c @@ -575,8 +575,8 @@ static VALUE rb_hash_become(hash, hash2) VALUE hash, hash2; { - if (hash == hash2) return hash; hash2 = to_hash(hash2); + if (hash == hash2) return hash; rb_hash_clear(hash); st_foreach(RHASH(hash2)->tbl, replace_i, hash); RHASH(hash)->ifnone = RHASH(hash2)->ifnone; -- cgit