1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:57:45 +00:00

LibRegex: Make Fork{Jump,Stay} non-recursive

This makes very fork-heavy expressions (like `(aa)*`) not run out of
stack space when matching very long strings.
This commit is contained in:
Ali Mohammad Pur 2021-07-31 16:03:45 +04:30 committed by Ali Mohammad Pur
parent a08870cc19
commit 5f342e4fa9
3 changed files with 29 additions and 52 deletions

View file

@ -65,8 +65,7 @@ public:
}
private:
Optional<bool> execute(MatchInput const& input, MatchState& state, MatchOutput& output, size_t recursion_level) const;
ALWAYS_INLINE Optional<bool> execute_low_prio_forks(MatchInput const& input, MatchState& original_state, MatchOutput& output, Vector<MatchState> states, size_t recursion_level) const;
Optional<bool> execute(MatchInput const& input, MatchState& state, MatchOutput& output) const;
Regex<Parser> const* m_pattern;
typename ParserTraits<Parser>::OptionsType const m_regex_options;