Skip to content

Commit b88126f

Browse files
committed
Fix oversight in DFA when changing OP_REVERSE; also add some unrelated tests
1 parent fdfbcd9 commit b88126f

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

src/pcre2_dfa_match.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ if (*this_start_code == OP_ASSERTBACK || *this_start_code == OP_ASSERTBACK_NOT)
591591
end_code = this_start_code;
592592
do
593593
{
594-
size_t back = (size_t)GET(end_code, 2+LINK_SIZE);
594+
size_t back = (size_t)GET2(end_code, 2+LINK_SIZE);
595595
if (back > max_back) max_back = back;
596596
end_code += GET(end_code, 1);
597597
}

testdata/testinput2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5988,6 +5988,12 @@ a)"xI
59885988

59895989
/(?<!( {65054}){9,44965})/
59905990

5991+
/(?(?<!|(|a)))/
5992+
aaaa\=get=0
5993+
5994+
/(?(?<!|a?))/
5995+
aaaa\=get=0
5996+
59915997
# --------
59925998

59935999
/(?<=(()()()()()()()()()()()()()(()()()()(())()()()()(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(())()()()()(()()()()()()(()()()()()()()()()()()()()()()()()()()()()(())()()()()(()()()()()()()()()()()()()(()()()()()()()()()()()()()(()())))))))))/

testdata/testoutput2

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17821,6 +17821,16 @@ Failed: error 200 at offset 5: branch too long in variable-length lookbehind ass
1782117821
/(?<!( {65054}){9,44965})/
1782217822
Failed: error 187 at offset 0: lookbehind assertion is too long
1782317823

17824+
/(?(?<!|(|a)))/
17825+
aaaa\=get=0
17826+
0:
17827+
0G (0)
17828+
17829+
/(?(?<!|a?))/
17830+
aaaa\=get=0
17831+
0:
17832+
0G (0)
17833+
1782417834
# --------
1782517835

1782617836
/(?<=(()()()()()()()()()()()()()(()()()()(())()()()()(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(())()()()()(()()()()()()(()()()()()()()()()()()()()()()()()()()()()(())()()()()(()()()()()()()()()()()()()(()()()()()()()()()()()()()(()())))))))))/

0 commit comments

Comments
 (0)