You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
valtree's to_le() actually produces different result on big-endian from little-endian. #103183
For commit https://github.com/rust-lang/rust/pull/96591/commits/e14b34c386ad2809e937e0e6e0379c5cc5474954 , the two `to_le()` actually produces different result on big-endian from little-endian.
// Note: Don't use `StableHashResult` impl of `u64` here directly, since that// would lead to endianness problems.let hash:u128 = hasher.finish();let hash_short = (hash.to_le()asu64).to_le();
Assume hash: u128=0x5e0f03940fda80bb6348c650c7b26618, then on LE, hash_short: u64 = 0x6348c650c7b26618, while BE hash_short: u64 = 0x5e0f03940fda80bb, which fails some unit tests on big endian targets because of hash mismatch.
If it's expected behavior to make hash value the same on BE/LE, code here should remove two to_le calls. We don't need to adjust endianness unless converting between multi-byte integer and byte sequences.
Activity
Rageking8 commentedon Oct 18, 2022
@rustbot label +C-bug
Auto merge of rust-lang#103231 - ecnelises:le_fix, r=lcnr
ecnelises commentedon Nov 23, 2022
Can we close this now? (I forgot to mention
Fixed xxxxin commit msg to trigger the bot) Not sure if I have the permission@rustbot close
rustbot commentedon Nov 23, 2022
Error: The feature
closeis not enabled in this repository.To enable it add its section in the
triagebot.tomlin the root of the repository.Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.
Auto merge of rust-lang#103231 - ecnelises:le_fix, r=lcnr