1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:07:44 +00:00

LibRegex: Make infinite repetitions short-circuit on empty matches

This makes (addmittedly weird) patterns like `(a*)*` work correctly
without going into an infinite fork loop.
This commit is contained in:
Ali Mohammad Pur 2021-09-06 02:38:47 +04:30 committed by Ali Mohammad Pur
parent f8570bd773
commit abbe9da255
4 changed files with 131 additions and 69 deletions

View file

@ -524,6 +524,7 @@ struct MatchState {
Vector<Match> matches;
Vector<Vector<Match>> capture_group_matches;
Vector<u64> repetition_marks;
HashMap<u64, u64> checkpoints;
};
}