diff options
author | Tim Shen <timshen91@gmail.com> | 2013-10-01 15:26:50 +0000 |
---|---|---|
committer | Tim Shen <timshen@gcc.gnu.org> | 2013-10-01 15:26:50 +0000 |
commit | 70b50ed7b5730785d6a16d6f7faae180e58af06b (patch) | |
tree | 361212cb84460e9074fad63cb9dd9eee059ddcb1 /libstdc++-v3/include | |
parent | 8da00d65132a5565ac574553a8f30b0c7c06afea (diff) | |
download | gcc-70b50ed7b5730785d6a16d6f7faae180e58af06b.zip gcc-70b50ed7b5730785d6a16d6f7faae180e58af06b.tar.gz gcc-70b50ed7b5730785d6a16d6f7faae180e58af06b.tar.bz2 |
re PR libstdc++/58576 (std::regex_match() reports mismatched braces on a valid regex)
2013-10-01 Tim Shen <timshen91@gmail.com>
PR libstdc++/58576
* include/bits/regex_automaton.tcc (_NFA<>::_M_eliminate_dummy)
(_StateSeq<>::_M_clone): Add _S_opcode_subexpr_lookahead branch.
* testsuite/28_regex/algorithms/regex_match/ecma/char/58576.cc: New.
From-SVN: r203067
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r-- | libstdc++-v3/include/bits/regex_automaton.tcc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libstdc++-v3/include/bits/regex_automaton.tcc b/libstdc++-v3/include/bits/regex_automaton.tcc index 13af984..3402ef3 100644 --- a/libstdc++-v3/include/bits/regex_automaton.tcc +++ b/libstdc++-v3/include/bits/regex_automaton.tcc @@ -175,7 +175,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION while (__it._M_next >= 0 && (*this)[__it._M_next]._M_opcode == _S_opcode_dummy) __it._M_next = (*this)[__it._M_next]._M_next; - if (__it._M_opcode == _S_opcode_alternative) + if (__it._M_opcode == _S_opcode_alternative + || __it._M_opcode == _S_opcode_subexpr_lookahead) while (__it._M_alt >= 0 && (*this)[__it._M_alt]._M_opcode == _S_opcode_dummy) __it._M_alt = (*this)[__it._M_alt]._M_next; @@ -201,7 +202,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION continue; if (__m.count(__dup._M_next) == 0) __stack.push(__dup._M_next); - if (__dup._M_opcode == _S_opcode_alternative) + if (__dup._M_opcode == _S_opcode_alternative + || __dup._M_opcode == _S_opcode_subexpr_lookahead) if (__m.count(__dup._M_alt) == 0) __stack.push(__dup._M_alt); } @@ -213,7 +215,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_DEBUG_ASSERT(__m.count(__ref._M_next)); __ref._M_next = __m[__ref._M_next]; } - if (__ref._M_opcode == _S_opcode_alternative) + if (__ref._M_opcode == _S_opcode_alternative + || __ref._M_opcode == _S_opcode_subexpr_lookahead) if (__ref._M_alt != -1) { _GLIBCXX_DEBUG_ASSERT(__m.count(__ref._M_alt)); |