Re: [Patch 2/3] Make regex's infinite loop detection accurate

2014-04-27 Thread Tim Shen
On Sun, Apr 27, 2014 at 8:30 AM, Jonathan Wakely wrote: >> This patch is OK to commit. > > > ... with the fix for the un-uglified variable name. Committed. Thanks! -- Regards, Tim Shen

Re: [Patch 2/3] Make regex's infinite loop detection accurate

2014-04-27 Thread Jonathan Wakely
On 27/04/14 13:28 +0100, Jonathan Wakely wrote: On 26/04/14 22:34 -0400, Tim Shen wrote: On Sat, Apr 26, 2014 at 1:00 PM, Jonathan Wakely wrote: Maybe a dumb question (I don't understand a lot of the regex code!) but is it correct to set this to 1 in the case where __rep_count.first != _M_curr

Re: [Patch 2/3] Make regex's infinite loop detection accurate

2014-04-27 Thread Jonathan Wakely
On 26/04/14 22:34 -0400, Tim Shen wrote: On Sat, Apr 26, 2014 at 1:00 PM, Jonathan Wakely wrote: Maybe a dumb question (I don't understand a lot of the regex code!) but is it correct to set this to 1 in the case where __rep_count.first != _M_current ? Could that result in the count going downw

Re: [Patch 2/3] Make regex's infinite loop detection accurate

2014-04-26 Thread Tim Shen
On Sat, Apr 26, 2014 at 1:00 PM, Jonathan Wakely wrote: > Maybe a dumb question (I don't understand a lot of the regex code!) > but is it correct to set this to 1 in the case where > __rep_count.first != _M_current ? Could that result in the count > going downwards from 2 to 1? (Maybe that's corr

Re: [Patch 2/3] Make regex's infinite loop detection accurate

2014-04-26 Thread Jonathan Wakely
On 25/04/14 18:03 -0400, Tim Shen wrote: * include/bits/regex_executor.h: Add _M_rep_count to track how many times this repeat node are visited. "is visited" not "are visited" @@ -151,6 +156,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // character. std::unique_ptr>> _M_

Re: [Patch 2/3] Make regex's infinite loop detection accurate

2014-04-25 Thread Tim Shen
On Fri, Apr 25, 2014 at 4:40 PM, Tim Shen wrote: > regex_match("", regex("(?:)*") will cause segfault because the > infinite loop detection (writeen by me) is stupid. :O Patch attached. -- Regards, Tim Shen commit 71b52302793f501a60783ea6dec09202120ce592 Author: tim Date: Fri Apr 25 01:50:1

[Patch 2/3] Make regex's infinite loop detection accurate

2014-04-25 Thread Tim Shen
regex_match("", regex("(?:)*") will cause segfault because the infinite loop detection (writeen by me) is stupid. :O Instead of checking begins and ends, now the executor tracks repeating count for every loop node (typically generated from the Kleene star *). It slows down the executor a bit (fro