зеркало из https://github.com/github/ruby.git
siphash.c: fix missing condition
* siphash.c (sip_hash24): fix for aligned word access little endian platforms. [ruby-core:58658] [Bug #9172] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
dacc2c2436
Коммит
59ed302965
|
@ -1,3 +1,8 @@
|
|||
Sat Nov 30 13:28:13 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* siphash.c (sip_hash24): fix for aligned word access little endian
|
||||
platforms. [ruby-core:58658] [Bug #9172]
|
||||
|
||||
Sat Nov 30 13:21:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* vm_eval.c (rb_yield_block): implement non-nil block argument.
|
||||
|
|
|
@ -417,7 +417,7 @@ sip_hash24(const uint8_t key[16], const uint8_t *data, size_t len)
|
|||
SIP_2_ROUND(m, v0, v1, v2, v3);
|
||||
}
|
||||
}
|
||||
#elif BYTE_ORDER == BIG_ENDIAN
|
||||
#else
|
||||
for (; data != end; data += sizeof(uint64_t)) {
|
||||
m = U8TO64_LE(data);
|
||||
SIP_2_ROUND(m, v0, v1, v2, v3);
|
||||
|
@ -453,7 +453,7 @@ sip_hash24(const uint8_t key[16], const uint8_t *data, size_t len)
|
|||
last.lo |= ((uint32_t *) end)[0];
|
||||
#endif
|
||||
break;
|
||||
#elif BYTE_ORDER == BIG_ENDIAN
|
||||
#else
|
||||
OR_BYTE(3);
|
||||
#endif
|
||||
case 3:
|
||||
|
|
|
@ -886,6 +886,8 @@ class TestString < Test::Unit::TestCase
|
|||
assert_not_equal(S("hello").hash, S("helLO").hash)
|
||||
bug4104 = '[ruby-core:33500]'
|
||||
assert_not_equal(S("a").hash, S("a\0").hash, bug4104)
|
||||
bug9172 = '[ruby-core:58658] [Bug #9172]'
|
||||
assert_not_equal(S("sub-setter").hash, S("discover").hash, bug9172)
|
||||
end
|
||||
|
||||
def test_hash_random
|
||||
|
|
Загрузка…
Ссылка в новой задаче