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:
parent
f8570bd773
commit
abbe9da255
4 changed files with 131 additions and 69 deletions
|
@ -524,6 +524,7 @@ struct MatchState {
|
|||
Vector<Match> matches;
|
||||
Vector<Vector<Match>> capture_group_matches;
|
||||
Vector<u64> repetition_marks;
|
||||
HashMap<u64, u64> checkpoints;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue