Skip to content

Commit

Permalink
Suppress ASAN warning
Browse files Browse the repository at this point in the history
  • Loading branch information
animetosho committed Sep 4, 2023
1 parent f24511f commit 9f57fda
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion parpar/gf16/gf16_checksum_x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ ALIGN_TO(64, static char load_mask[64]) = {
#endif

// load part of a vector, zeroing out remaining bytes
static inline _mword partial_load(const void* ptr, size_t bytes) {
static inline _mword partial_load(const void* ptr, size_t bytes)
#if HEDLEY_HAS_ATTRIBUTE(no_sanitize)
__attribute__((no_sanitize("address"))) // suppress 'heap-buffer-overflow' due to possibly reading past the end of the buffer; as it's an aligned load, it'll never actually cause a fault
#endif
{
#if MWORD_SIZE == 64
// AVX512 is easy - masked load does the trick
return _mm512_maskz_loadu_epi8((1ULL<<bytes)-1, ptr);
Expand Down
2 changes: 1 addition & 1 deletion parpar/gf16/gf16_muladd_multi.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ typedef void (*const fMuladdPF)
);

// suppress UBSan warning about adding to a NULL pointer; `coefficients` can be NULL from gf_add*, but it's never used there, and it's annoying to have to check and branch on these
#if defined(__clang__)
#if defined(__clang__) && HEDLEY_HAS_ATTRIBUTE(no_sanitize)
# define IGNORE_NULL_ADD __attribute__((no_sanitize("pointer-overflow")))
#else
# define IGNORE_NULL_ADD
Expand Down

0 comments on commit 9f57fda

Please sign in to comment.