Skip to content

Commit 3b1cd38

Browse files
kongyGerrit Code Review
authored andcommitted
Merge "Turn off integer overflow UBSAN checks for hash functions" into main
2 parents 315a0f1 + 93926f6 commit 3b1cd38

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

libs/ui/DisplayIdentification.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ uint64_t shiftMix(uint64_t val) {
4747
return val ^ (val >> 47);
4848
}
4949

50+
__attribute__((no_sanitize("unsigned-integer-overflow")))
5051
uint64_t hash64Len16(uint64_t u, uint64_t v) {
5152
constexpr uint64_t kMul = 0x9ddfea08eb382d69;
5253
uint64_t a = (u ^ v) * kMul;
@@ -57,6 +58,7 @@ uint64_t hash64Len16(uint64_t u, uint64_t v) {
5758
return b;
5859
}
5960

61+
__attribute__((no_sanitize("unsigned-integer-overflow")))
6062
uint64_t hash64Len0To16(const char* s, uint64_t len) {
6163
constexpr uint64_t k2 = 0x9ae16a3b2f90404f;
6264
constexpr uint64_t k3 = 0xc949d7c7509e6557;
@@ -401,4 +403,4 @@ uint64_t cityHash64Len0To16(std::string_view sv) {
401403
return hash64Len0To16(sv.data(), len);
402404
}
403405

404-
} // namespace android
406+
} // namespace android

0 commit comments

Comments
 (0)