From 69c213fbc72dc33d1a884660ec6c67b134a796e9 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 1 May 2008 14:04:38 +0000 Subject: * hash.c (rb_hash_s_create): should access converted hash value. [ruby-dev:34555] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- hash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hash.c') diff --git a/hash.c b/hash.c index 8d3567e315..2ba8033b77 100644 --- a/hash.c +++ b/hash.c @@ -344,8 +344,8 @@ rb_hash_s_create(int argc, VALUE *argv, VALUE klass) tmp = rb_hash_s_try_convert(Qnil, argv[0]); if (!NIL_P(tmp)) { hash = hash_alloc(klass); - if (RHASH(argv[0])->ntbl) { - RHASH(hash)->ntbl = st_copy(RHASH(argv[0])->ntbl); + if (RHASH(tmp)->ntbl) { + RHASH(hash)->ntbl = st_copy(RHASH(tmp)->ntbl); } return hash; } -- cgit v1.2.3