Skip to content

Commit

Permalink
Fix oversight in DFA when changing OP_REVERSE; also add some unrelate…
Browse files Browse the repository at this point in the history
…d tests
  • Loading branch information
PhilipHazel committed Nov 16, 2023
1 parent fdfbcd9 commit b88126f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/pcre2_dfa_match.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ if (*this_start_code == OP_ASSERTBACK || *this_start_code == OP_ASSERTBACK_NOT)
end_code = this_start_code;
do
{
size_t back = (size_t)GET(end_code, 2+LINK_SIZE);
size_t back = (size_t)GET2(end_code, 2+LINK_SIZE);
if (back > max_back) max_back = back;
end_code += GET(end_code, 1);
}
Expand Down
6 changes: 6 additions & 0 deletions testdata/testinput2
Original file line number Diff line number Diff line change
Expand Up @@ -5988,6 +5988,12 @@ a)"xI

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

/(?(?<!|(|a)))/
aaaa\=get=0

/(?(?<!|a?))/
aaaa\=get=0

# --------

/(?<=(()()()()()()()()()()()()()(()()()()(())()()()()(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(())()()()()(()()()()()()(()()()()()()()()()()()()()()()()()()()()()(())()()()()(()()()()()()()()()()()()()(()()()()()()()()()()()()()(()())))))))))/
Expand Down
10 changes: 10 additions & 0 deletions testdata/testoutput2
Original file line number Diff line number Diff line change
Expand Up @@ -17821,6 +17821,16 @@ Failed: error 200 at offset 5: branch too long in variable-length lookbehind ass
/(?<!( {65054}){9,44965})/
Failed: error 187 at offset 0: lookbehind assertion is too long

/(?(?<!|(|a)))/
aaaa\=get=0
0:
0G (0)

/(?(?<!|a?))/
aaaa\=get=0
0:
0G (0)

# --------

/(?<=(()()()()()()()()()()()()()(()()()()(())()()()()(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(())()()()()(()()()()()()(()()()()()()()()()()()()()()()()()()()()()(())()()()()(()()()()()()()()()()()()()(()()()()()()()()()()()()()(()())))))))))/
Expand Down

0 comments on commit b88126f

Please sign in to comment.