Fix code to handle multiple named-subexpressions with the same name.

Updated test cases to match.

[SVN r65943]
This commit is contained in:
John Maddock
2010-10-13 16:53:13 +00:00
parent a35cb5b902
commit 29088ce346
9 changed files with 149 additions and 99 deletions

View File

@ -806,7 +806,13 @@ void basic_regex_creator<charT, traits>::fixup_recursions(re_syntax_base* state)
re_syntax_base* p = base;
std::ptrdiff_t idx = static_cast<re_jump*>(state)->alt.i;
if(idx > 10000)
{
//
// There may be more than one capture group with this hash, just do what Perl
// does and recurse to the leftmost:
//
idx = m_pdata->get_id(idx);
}
while(p)
{
if((p->type == syntax_element_startmark) && (static_cast<re_brace*>(p)->index == idx))