On Mon, Aug 19, 2013 at 06:07:10PM +0800, Tim Shen wrote:
> Before this patch, it causes the executor into infinite loop.
>
> Tested under x86_64. I'll test -m32 and check-debug before committing.
@@ -2371,8 +2372,10 @@
if (__re._M_automaton == nullptr)
return false;
for (auto __cur = __first; __cur != __last; ++__cur) // Any KMP-like
algo?
- if (__detail::__get_executor(__cur, __last, __m, __re, __flags)
- ->_M_search_from_first())
+ {
+ __detail::__get_executor(__cur, __last, __m, __re, __flags)
+ ->_M_search_from_first();
+ if (__m.size() > 0 && __m[0].matched)
{
for (auto __it : __m)
if (!__it.matched)
@@ -2387,6 +2390,7 @@
(__m.suffix().first != __m.suffix().second);
return true;
}
Doesn't everything in between the last added line above and the first added
line below need reindenting by 2 spaces (plus of course transforming any 8
consecutive spaces into tabs)?
+ }
return false;
}
Jakub