diff --git a/ChangeLog b/ChangeLog index 78bcc0f..46230ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -39,6 +39,8 @@ assertion could always be wrapped in a repeated group. The only restriction that is now imposed is that an unlimited maximum is changed to one more than the minimum. +10. Fix *THEN verbs in lookahead assertions in JIT. + Version 10.34 21-November-2019 ------------------------------ diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c index 78b94c1..00d13f1 100644 --- a/src/pcre2_jit_compile.c +++ b/src/pcre2_jit_compile.c @@ -9597,7 +9597,8 @@ if (opcode == OP_ASSERT || opcode == OP_ASSERTBACK) } else { - OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), 0); + SLJIT_ASSERT(extrasize == 3); + OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(-1)); OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), bra == OP_BRAZERO ? STR_PTR : SLJIT_IMM, 0); } } diff --git a/src/pcre2_jit_test.c b/src/pcre2_jit_test.c index e0638ef..a188724 100644 --- a/src/pcre2_jit_test.c +++ b/src/pcre2_jit_test.c @@ -860,6 +860,7 @@ static struct regression_test_case regression_test_cases[] = { { MU, A, 0, 0, "(?(?!a(*THEN)b)ad|add)", "add" }, { MU, A, 0, 0 | F_NOMATCH, "(?(?=a)a(*THEN)b|ad)", "ad" }, { MU, A, 0, 0, "(?!(?(?=a)ab|b(*THEN)d))bn|bnn", "bnn" }, + { MU, A, 0, 0, "(?=(*THEN: ))* ", " " }, /* Recurse and control verbs. */ { MU, A, 0, 0, "(a(*ACCEPT)b){0}a(?1)b", "aacaabb" },