[Bug libstdc++/93502] std::regex_match uses stack space proportional to input string length

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jan 30 07:59:00 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93502

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Nadav Har'El from comment #2)
> Maybe you mean it is a dup of
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86164 ?

Yes that's what I was thinking of.

> But I'm not sure. I honestly don't understand the conclusion there that ".*"
> is implemented recursively. Why would such a simple case, easily converted
> to a deterministic finite automaton with no memory usage at all - need
> recursion? 

Nobody said it *needs* recursion, that's just how it's implemented today.


More information about the Gcc-bugs mailing list