From: timshen Date: Fri, 2 Jan 2015 22:33:04 +0000 (+0000) Subject: PR libstdc++/64475 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9be8500a4a461abb33b833dec6a62fa5039b1172;p=thirdparty%2Fgcc.git PR libstdc++/64475 * include/bits/regex_executor.tcc (_Executor<>::_M_dfs): Copy the iterator, since the original one shouldn't be mutated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219151 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 121ac771e64d..4c9dc052244d 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2015-01-02 Tim Shen + + PR libstdc++/64475 + * include/bits/regex_executor.tcc (_Executor<>::_M_dfs): Copy the + iterator, since the original one shouldn't be mutated. + 2015-01-02 Bernd Edlinger PR libstdc++/64422 diff --git a/libstdc++-v3/include/bits/regex_executor.tcc b/libstdc++-v3/include/bits/regex_executor.tcc index 7954d06eb3ff..a9736675bf60 100644 --- a/libstdc++-v3/include/bits/regex_executor.tcc +++ b/libstdc++-v3/include/bits/regex_executor.tcc @@ -310,7 +310,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION if (!__submatch.matched) break; auto __last = _M_current; - for (auto& __tmp = __submatch.first; + for (auto __tmp = __submatch.first; __last != _M_end && __tmp != __submatch.second; ++__tmp) ++__last;