aboutsummaryrefslogtreecommitdiffstats
path: root/array.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-10 14:44:51 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-10 14:44:51 +0000
commit037a9d06559e25cce2368979cecba710ddb4765d (patch)
tree0be9ec71e9ea51081b5c57f7c69495d869f92b7f /array.c
parente5b5ee7487a55f6afd3bed90c6716a07ba0d3065 (diff)
downloadruby-037a9d06559e25cce2368979cecba710ddb4765d.tar.gz
array.c, hash.c: add salt
* array.c (rb_ary_hash): add salt to differentiate false and empty array. [ruby-core:58993] [Bug #9231] * hash.c (rb_any_hash, rb_hash_hash): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/array.c b/array.c
index e6a45e86fd..b6d8a5584c 100644
--- a/array.c
+++ b/array.c
@@ -3792,6 +3792,7 @@ rb_ary_hash(VALUE ary)
VALUE n;
h = rb_hash_start(RARRAY_LEN(ary));
+ h = rb_hash_uint(h, (st_index_t)rb_ary_hash);
for (i=0; i<RARRAY_LEN(ary); i++) {
n = rb_hash(RARRAY_AREF(ary, i));
h = rb_hash_uint(h, NUM2LONG(n));