summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-08 06:55:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-08 06:55:24 +0000
commitab6efa5be2f5a2fb1b5a05a90f398b27ea52617a (patch)
tree621c25b0d22646d05c80e79886314a79061b86b4 /object.c
parent06f624b8915fbddbb13c010ee1a61f266708285b (diff)
object.c: hash value from objid with salt
* hash.c (rb_objid_hash): return hash value from object ID with a salt, extract from rb_any_hash(). * object.c (rb_obj_hash): return same value as rb_any_hash(). fix r44125. [ruby-core:59638] [Bug #9381] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/object.c b/object.c
index e54285d..1398201 100644
--- a/object.c
+++ b/object.c
@@ -161,6 +161,7 @@ rb_obj_equal(VALUE obj1, VALUE obj2)
VALUE
rb_obj_hash(VALUE obj)
{
+ st_index_t rb_objid_hash(st_index_t index);
VALUE oid = rb_obj_id(obj);
#if SIZEOF_LONG == SIZEOF_VOIDP
st_index_t index = NUM2LONG(oid);
@@ -169,7 +170,7 @@ rb_obj_hash(VALUE obj)
#else
# error not supported
#endif
- st_index_t h = rb_hash_end(rb_hash_start(index));
+ st_index_t h = rb_objid_hash(index);
return LONG2FIX(h);
}