diff --git a/src/hb-ot-kern-table.hh b/src/hb-ot-kern-table.hh index dab7a805f..3cc11d100 100644 --- a/src/hb-ot-kern-table.hh +++ b/src/hb-ot-kern-table.hh @@ -37,6 +37,7 @@ struct hb_kern_machine_t { hb_kern_machine_t (const Driver &driver_) : driver (driver_) {} + HB_NO_SANITIZE_SIGNED_INTEGER_OVERFLOW inline void kern (hb_font_t *font, hb_buffer_t *buffer, hb_mask_t kern_mask) const diff --git a/src/hb.hh b/src/hb.hh index 5d0396a67..098b56604 100644 --- a/src/hb.hh +++ b/src/hb.hh @@ -237,6 +237,15 @@ struct _hb_alignof # define HB_FALLTHROUGH /* FALLTHROUGH */ #endif +#if defined(__clang__) +/* Disable certain sanitizer errors. */ +/* https://github.com/harfbuzz/harfbuzz/issues/1247 */ +#define HB_NO_SANITIZE_SIGNED_INTEGER_OVERFLOW __attribute__((no_sanitize("signed-integer-overflow"))) +#else +#define HB_NO_SANITIZE_SIGNED_INTEGER_OVERFLOW +#endif + + #if defined(_WIN32) || defined(__CYGWIN__) /* We need Windows Vista for both Uniscribe backend and for * MemoryBarrier. We don't support compiling on Windows XP,