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
commit 5f342e4fa9
Notes: sideshowbarker 2024-07-18 07:35:17 +09:00
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;