summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-18 08:05:17 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-18 08:05:17 +0000
commit88cab63a07aff9731026f7191d9c4263f7fe11b8 (patch)
tree2f50bda0dd607136eb9c2c8d3347dfd7ac2752b7 /hash.c
parent85bae86cb63bc564959f4649a837fcffdccae3ae (diff)
* hash.c (rb_hash_aset): string key copying only happen if key is
an exact instance of String, not a subclass. based on a patch from Mike Gold <mike.gold.4433 at gmail.com> in [ruby-talk:322667]. [incompatible] [ruby-talk:322417] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hash.c b/hash.c
index 044964c809..f3bd0b66b8 100644
--- a/hash.c
+++ b/hash.c
@@ -984,7 +984,7 @@ rb_hash_aset(VALUE hash, VALUE key, VALUE val)
{
rb_hash_modify(hash);
if (RHASH(hash)->ntbl->type == &identhash ||
- TYPE(key) != T_STRING || st_lookup(RHASH(hash)->ntbl, key, 0)) {
+ rb_obj_class(key) != rb_cString || st_lookup(RHASH(hash)->ntbl, key, 0)) {
st_insert(RHASH(hash)->ntbl, key, val);
}
else {