From d38c7f7e8dcbf59c3d61582b4170e599a075a83f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Herczeg?= Date: Thu, 17 Jan 2019 11:47:59 +0000 Subject: [PATCH] Fix word boundary in JIT compiler. Patch by Mike Munday. --- ChangeLog | 2 ++ src/pcre2_jit_compile.c | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7689f25..49d091f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -112,6 +112,8 @@ independently of PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL. sequences such as \eX when they appeared invalidly in a character class. Now the option applies only to unrecognized or malformed escape sequences. +28. Fix word boundary in JIT compiler. Patch by Mike Munday. + Version 10.32 10-September-2018 ------------------------------- diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c index ba56b83..dc659ca 100644 --- a/src/pcre2_jit_compile.c +++ b/src/pcre2_jit_compile.c @@ -6841,7 +6841,7 @@ else set_jumps(skipread_list, LABEL()); OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0); -OP2(SLJIT_XOR, TMP2, 0, TMP2, 0, TMP3, 0); +OP2(SLJIT_XOR | SLJIT_SET_Z, TMP2, 0, TMP2, 0, TMP3, 0); sljit_emit_fast_return(compiler, TMP1, 0); #ifdef SUPPORT_UNICODE @@ -6856,7 +6856,6 @@ if (common->invalid_utf) return; } #endif /* SUPPORT_UNICODE */ -SLJIT_ASSERT(invalid_utf == NULL); } static BOOL optimize_class_ranges(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL invert, jump_list **backtracks)