Skip to content

Commit

Permalink
hash: murmur: Add no_sanitize to make ubsan happy
Browse files Browse the repository at this point in the history
It is just a normal array index usage, no alignment is needed.

Signed-off-by: Anatol Belski <ab@php.net>
  • Loading branch information
weltling committed Oct 31, 2020
1 parent e31e90f commit 7cfaafb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ext/hash/murmur/endianness.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ FORCE_INLINE uint64_t BSWAP64(uint64_t u)
}
#endif

#ifdef __clang__
__attribute__((no_sanitize("alignment")))
#endif
FORCE_INLINE uint32_t getblock32 ( const uint32_t * const p, const int i)
{
if (IsBigEndian()) {
Expand All @@ -64,6 +67,9 @@ FORCE_INLINE uint32_t getblock32 ( const uint32_t * const p, const int i)
}
}

#ifdef __clang__
__attribute__((no_sanitize("alignment")))
#endif
FORCE_INLINE uint64_t getblock64 ( const uint64_t * const p, const int i)
{
if (IsBigEndian()) {
Expand Down

0 comments on commit 7cfaafb

Please sign in to comment.