From ac3c653001e65654786a36fb6159d3ea94a8346c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= Date: Fri, 6 Oct 2023 14:32:43 -0700 Subject: [PATCH] jit: disable ASAN for arm64 SIMD helper While it would be ideal to disable only the expected buffer over reads or let users add the generated functions to an exception list, this will at least prevent the unexpected crash that ASAN would trigger otherwise by default. --- src/pcre2_jit_neon_inc.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pcre2_jit_neon_inc.h b/src/pcre2_jit_neon_inc.h index 64f5d480e..4a718b67b 100644 --- a/src/pcre2_jit_neon_inc.h +++ b/src/pcre2_jit_neon_inc.h @@ -82,6 +82,11 @@ POSSIBILITY OF SUCH DAMAGE. # endif # endif +#if (defined(__GNUC__) && __SANITIZE_ADDRESS__) \ + || (defined(__clang__) \ + && ((__clang_major__ == 3 && __clang_minor__ >= 3) || (__clang_major__ > 3))) +__attribute__((no_sanitize_address)) +#endif static sljit_u8* SLJIT_FUNC FF_FUN(sljit_u8 *str_end, sljit_u8 **str_ptr, sljit_uw offs1, sljit_uw offs2, sljit_uw chars) #undef FF_FUN {