mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-20 04:18:26 +01:00
Merge "dsp.h: add WEBP_UBSAN_IGNORE_UNDEF"
This commit is contained in:
commit
ea24e026aa
@ -102,6 +102,19 @@ extern "C" {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// This macro prevents the undefined behavior sanitizer from reporting
|
||||
// failures. This is only meant to silence unaligned loads on platforms that
|
||||
// are known to support them.
|
||||
#define WEBP_UBSAN_IGNORE_UNDEF
|
||||
#if !defined(WEBP_FORCE_ALIGNED) && defined(__clang__) && \
|
||||
defined(__has_attribute)
|
||||
#if __has_attribute(no_sanitize)
|
||||
#undef WEBP_UBSAN_IGNORE_UNDEF
|
||||
#define WEBP_UBSAN_IGNORE_UNDEF \
|
||||
__attribute__((no_sanitize("undefined")))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
kSSE2,
|
||||
kSSE3,
|
||||
|
@ -55,7 +55,8 @@ void VP8LoadFinalBytes(VP8BitReader* const br);
|
||||
// Inlined critical functions
|
||||
|
||||
// makes sure br->value_ has at least BITS bits worth of data
|
||||
static WEBP_INLINE void VP8LoadNewBytes(VP8BitReader* const br) {
|
||||
static WEBP_UBSAN_IGNORE_UNDEF WEBP_INLINE
|
||||
void VP8LoadNewBytes(VP8BitReader* const br) {
|
||||
assert(br != NULL && br->buf_ != NULL);
|
||||
// Read 'BITS' bits at a time if possible.
|
||||
if (br->buf_ < br->buf_max_) {
|
||||
|
Loading…
Reference in New Issue
Block a user