mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +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
Notes:
sideshowbarker
2024-07-18 04:37:58 +09:00
Author: https://github.com/alimpfard
Commit: abbe9da255
Pull-request: https://github.com/SerenityOS/serenity/pull/9847
Reviewed-by: https://github.com/linusg ✅
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