This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, PR 61061] Add state limit for regex NFA
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Tim Shen <timshen91 at gmail dot com>, libstdc++ <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 27 Jun 2014 09:37:46 +0200
- Subject: Re: [Patch, PR 61061] Add state limit for regex NFA
- Authentication-results: sourceware.org; auth=none
- References: <CAPrifDkixkdXADF-_eG9rp0vhGwS+NKCTmCvruwXR4A5k5z=kA at mail dot gmail dot com>
Hi,
On 06/27/2014 05:56 AM, Tim Shen wrote:
The limit can be customized by defining a macro
_GLIBCXX_REGEX_STATE_LIMIT. The default value is 100000.
The testcase can be handled if we optimize consecutive quantifiers
(collapse them to one). But cases like "(a{100}b){100}" can't be
handled still.
We implement range quantifier "(foo){n}" by copying state sequence
(foo) n-1 times. That consumes more space. We may reimplement it (by
adding a new _S_op*) someday.
Bootstrapped and tested.
The actual patch is missing.. ;)
Paolo.
PS: sorry for being distracted by other issues: what happened to the
other regex issue? I think we are simply going to apply, when ready,
your more complete fix, right?