Skip to content

Commit

Permalink
Suppress MemorySanitizer false positive
Browse files Browse the repository at this point in the history
MemorySanitizer does not support assembly, and therefore produces a
false positive on `blake3_hasher_finalize` and related functions.
  • Loading branch information
jbms committed Feb 17, 2023
1 parent 64747d4 commit c272abe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions c/blake3.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ INLINE void output_root_bytes(const output_t *self, uint64_t seek, uint8_t *out,
output_block_counter += 1;
offset_within_block = 0;
}
#ifdef __has_feature
#if __has_feature(memory_sanitizer)
// MemorySanitizer gives a false positive due to use of assembly.
__msan_unpoison(out, out_len);
#endif
#endif
}

INLINE void chunk_state_update(blake3_chunk_state *self, const uint8_t *input,
Expand Down

0 comments on commit c272abe

Please sign in to comment.