diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c index d0e178fe8..6af538fb4 100644 --- a/src/pcre2_jit_compile.c +++ b/src/pcre2_jit_compile.c @@ -11314,7 +11314,7 @@ if (bra == OP_BRAMINZERO) /* Continue to the normal backtrack. */ } -if ((ket != OP_KET && bra != OP_BRAMINZERO) || bra == OP_BRAZERO) +if ((ket != OP_KET && bra != OP_BRAMINZERO) || bra == OP_BRAZERO || (has_alternatives && repeat_type != OP_EXACT)) count_match(common); cc += 1 + LINK_SIZE; diff --git a/src/pcre2_jit_test.c b/src/pcre2_jit_test.c index f3f6ff760..f051bd29a 100644 --- a/src/pcre2_jit_test.c +++ b/src/pcre2_jit_test.c @@ -276,6 +276,7 @@ static struct regression_test_case regression_test_cases[] = { { CM, A, 0, 0, "a1277|a1377|bX487", "bx487" }, { CM, A, 0, 0, "a1277|a1377|bx487", "bX487" }, { 0, A, 0, 0, "(a|)b*+a", "a" }, + { 0, A, 0, 0 | F_NOMATCH, "(.|.|.|.|.)(|.|.|.|.)(.||.|.|.)(.|.||.|.)(.|.|.||.)(.|.|.|.|)(A|.|.|.|.)(.|A|.|.|.)(.|.|A|.|.)(.|.|.|A|.)(.|.|.|.|A)(B|.|.|.|.)(.|B|.|.|.)(.|.|B|.|.)(.|.|.|B|.)(.|.|.|.|B)xa", "1234567890123456ax" }, /* Greedy and non-greedy ? operators. */ { MU, A, 0, 0, "(?:a)?a", "laab" },