* string.c (rb_memhash): zero-filled strings should return
different values. [ruby-core:33500] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d264d3cc38
commit
417ea3a3c3
@ -1,3 +1,8 @@
|
|||||||
|
Wed Dec 1 14:36:36 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* string.c (rb_memhash): zero-filled strings should return
|
||||||
|
different values. [ruby-core:33500]
|
||||||
|
|
||||||
Wed Dec 1 14:27:49 2010 Ryan Davis <ryand-ruby@zenspider.com>
|
Wed Dec 1 14:27:49 2010 Ryan Davis <ryand-ruby@zenspider.com>
|
||||||
|
|
||||||
* lib/minitest/*.rb: Imported minitest 2.0.0 r5952.
|
* lib/minitest/*.rb: Imported minitest 2.0.0 r5952.
|
||||||
|
2
string.c
2
string.c
@ -2073,7 +2073,7 @@ rb_str_prepend(VALUE str, VALUE str2)
|
|||||||
st_index_t
|
st_index_t
|
||||||
rb_memhash(const void *ptr, long len)
|
rb_memhash(const void *ptr, long len)
|
||||||
{
|
{
|
||||||
return st_hash(ptr, len, rb_hash_start(0));
|
return st_hash(ptr, len, rb_hash_start((st_index_t)len));
|
||||||
}
|
}
|
||||||
|
|
||||||
st_index_t
|
st_index_t
|
||||||
|
@ -727,6 +727,8 @@ class TestString < Test::Unit::TestCase
|
|||||||
def test_hash
|
def test_hash
|
||||||
assert_equal(S("hello").hash, S("hello").hash)
|
assert_equal(S("hello").hash, S("hello").hash)
|
||||||
assert(S("hello").hash != S("helLO").hash)
|
assert(S("hello").hash != S("helLO").hash)
|
||||||
|
bug4104 = '[ruby-core:33500]'
|
||||||
|
assert_not_equal(S("a").hash, S("a\0").hash, bug4104)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_hash_random
|
def test_hash_random
|
||||||
|
Loading…
x
Reference in New Issue
Block a user