From 4d23d9e7d8bda4f1231b5696a714fee735cdad90 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@2904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hash.c') diff --git a/hash.c b/hash.c index 6e1c247ba4..69ca1db4e3 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 v1.2.3