From 0328f39059a0a03f1ced8b81f6450481f54d84d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= Date: Fri, 2 Dec 2022 00:00:30 -0800 Subject: [PATCH] jit: correctly implement utf_continue() for utf16 Resulting in a constant false result. --- src/pcre2_jit_neon_inc.h | 2 +- src/pcre2_jit_simd_inc.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pcre2_jit_neon_inc.h b/src/pcre2_jit_neon_inc.h index 150da29eb..e74adf123 100644 --- a/src/pcre2_jit_neon_inc.h +++ b/src/pcre2_jit_neon_inc.h @@ -327,7 +327,7 @@ match:; return NULL; #if defined(FF_UTF) - if (utf_continue(str_ptr + IN_UCHARS(-offs1))) + if (utf_continue((PCRE2_SPTR)str_ptr - offs1)) { /* Not a match. */ str_ptr += IN_UCHARS(1); diff --git a/src/pcre2_jit_simd_inc.h b/src/pcre2_jit_simd_inc.h index d99cfc5ce..1a5ce4ed0 100644 --- a/src/pcre2_jit_simd_inc.h +++ b/src/pcre2_jit_simd_inc.h @@ -776,7 +776,7 @@ typedef union { } int_char; #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 -static SLJIT_INLINE int utf_continue(sljit_u8 *s) +static SLJIT_INLINE int utf_continue(PCRE2_SPTR s) { #if PCRE2_CODE_UNIT_WIDTH == 8 return (*s & 0xc0) == 0x80;