summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-01 14:04:38 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-01 14:04:38 +0000
commitee7f5e44bcd599df28e04f95625375d028566642 (patch)
tree75f7f384423cea7796cda36768cee52257c88160 /hash.c
parent55ff769bf4c569a51a7c5bc164f76e5d1e4ebd12 (diff)
downloadruby-ee7f5e44bcd599df28e04f95625375d028566642.tar.gz
ruby-ee7f5e44bcd599df28e04f95625375d028566642.tar.xz
ruby-ee7f5e44bcd599df28e04f95625375d028566642.zip
* hash.c (rb_hash_s_create): should access converted hash value.
[ruby-dev:34555] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hash.c b/hash.c
index 8d3567e31..2ba8033b7 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;
}