Skip to content

Commit 7cfaafb

Browse files
committed
hash: murmur: Add no_sanitize to make ubsan happy
It is just a normal array index usage, no alignment is needed. Signed-off-by: Anatol Belski <ab@php.net>
1 parent e31e90f commit 7cfaafb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ext/hash/murmur/endianness.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ FORCE_INLINE uint64_t BSWAP64(uint64_t u)
5555
}
5656
#endif
5757

58+
#ifdef __clang__
59+
__attribute__((no_sanitize("alignment")))
60+
#endif
5861
FORCE_INLINE uint32_t getblock32 ( const uint32_t * const p, const int i)
5962
{
6063
if (IsBigEndian()) {
@@ -64,6 +67,9 @@ FORCE_INLINE uint32_t getblock32 ( const uint32_t * const p, const int i)
6467
}
6568
}
6669

70+
#ifdef __clang__
71+
__attribute__((no_sanitize("alignment")))
72+
#endif
6773
FORCE_INLINE uint64_t getblock64 ( const uint64_t * const p, const int i)
6874
{
6975
if (IsBigEndian()) {

0 commit comments

Comments
 (0)