Commit 45bedee3 authored by Lucian Grijincu's avatar Lucian Grijincu Committed by facebook-github-bot-1

folly: ubsan: HashTest: avoid invalid shift (sanitize=shift)

Summary:
  [ RUN      ] Hash.TWang_Unmix64
  folly/test/HashTest.cpp:125:20: runtime error: shift exponent 32 is too large for 32-bit type 'unsigned int'

Reviewed By: philippv

Differential Revision: D2886144

fb-gh-sync-id: 8d7963c087c9db34b08c07451d35e5568c750520
parent 9cbe74a3
......@@ -122,9 +122,9 @@ void checkTWang(uint64_t r) {
TEST(Hash, TWang_Unmix64) {
// We'll try (1 << i), (1 << i) + 1, (1 << i) - 1
for (int i = 1; i < 64; i++) {
checkTWang((1U << i) - 1);
checkTWang(1U << i);
checkTWang((1U << i) + 1);
checkTWang((uint64_t(1) << i) - 1);
checkTWang(uint64_t(1) << i);
checkTWang((uint64_t(1) << i) + 1);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment