diff options
author | timshen <timshen@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-12-15 04:50:29 +0000 |
---|---|---|
committer | timshen <timshen@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-12-15 04:50:29 +0000 |
commit | 482117409dbc2ff30ace1d760c4a5711444c2e38 (patch) | |
tree | fe2c602d1e564ff187667484cd664744240ba9e6 /libstdc++-v3/include | |
parent | d175f0193ed47b61eafd213ca2d3dde73f8f5996 (diff) | |
download | gcc-482117409dbc2ff30ace1d760c4a5711444c2e38.tar.gz |
PR libstdc++/68863
* include/bits/regex_executor.tcc (_Executor::_M_lookahead):
Copy the captured content for lookahead, so that the backreferences
inside can refer to them.
* testsuite/28_regex/algorithms/regex_match/ecma/char/68863.cc:
New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231641 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r-- | libstdc++-v3/include/bits/regex_executor.tcc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libstdc++-v3/include/bits/regex_executor.tcc b/libstdc++-v3/include/bits/regex_executor.tcc index a13f0d54249..f5be4d7cc06 100644 --- a/libstdc++-v3/include/bits/regex_executor.tcc +++ b/libstdc++-v3/include/bits/regex_executor.tcc @@ -147,7 +147,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION bool _Executor<_BiIter, _Alloc, _TraitsT, __dfs_mode>:: _M_lookahead(_StateIdT __next) { - _ResultsVec __what(_M_cur_results.size()); + // Backreferences may refer to captured content. + // We may want to make this faster by not copying, + // but let's not be clever prematurely. + _ResultsVec __what(_M_cur_results); _Executor __sub(_M_current, _M_end, __what, _M_re, _M_flags); __sub._M_states._M_start = __next; if (__sub._M_search_from_first()) |