|
Petr Machata |
8b63e4 |
*** boost/regex/v4/basic_regex_parser.hpp.orig 2008-01-14 12:53:01.000000000 -0600
|
|
Petr Machata |
8b63e4 |
--- boost/regex/v4/basic_regex_parser.hpp 2008-01-14 12:57:25.000000000 -0600
|
|
Petr Machata |
8b63e4 |
*************** bool basic_regex_parser<charT, traits>::
|
|
Petr Machata |
8b63e4 |
*** 777,782 ****
|
|
Petr Machata |
8b63e4 |
--- 777,783 ----
|
|
Petr Machata |
8b63e4 |
case syntax_element_restart_continue:
|
|
Petr Machata |
8b63e4 |
case syntax_element_jump:
|
|
Petr Machata |
8b63e4 |
case syntax_element_startmark:
|
|
Petr Machata |
8b63e4 |
+ case syntax_element_backstep:
|
|
Petr Machata |
8b63e4 |
// can't legally repeat any of the above:
|
|
Petr Machata |
8b63e4 |
fail(regex_constants::error_badrepeat, m_position - m_base);
|
|
Petr Machata |
8b63e4 |
return false;
|
|
Petr Machata |
8b63e4 |
*************** bool basic_regex_parser<charT, traits>::
|
|
Petr Machata |
8b63e4 |
*** 1862,1867 ****
|
|
Petr Machata |
8b63e4 |
--- 1863,1869 ----
|
|
Petr Machata |
8b63e4 |
if(markid == -4)
|
|
Petr Machata |
8b63e4 |
{
|
|
Petr Machata |
8b63e4 |
re_syntax_base* b = this->getaddress(expected_alt_point);
|
|
Petr Machata |
8b63e4 |
+ // Make sure we have exactly one alternative following this state:
|
|
Petr Machata |
8b63e4 |
if(b->type != syntax_element_alt)
|
|
Petr Machata |
8b63e4 |
{
|
|
Petr Machata |
8b63e4 |
re_alt* alt = static_cast<re_alt*>(this->insert_state(expected_alt_point, syntax_element_alt, sizeof(re_alt)));
|
|
Petr Machata |
8b63e4 |
*************** bool basic_regex_parser<charT, traits>::
|
|
Petr Machata |
8b63e4 |
*** 1872,1877 ****
|
|
Petr Machata |
8b63e4 |
--- 1874,1888 ----
|
|
Petr Machata |
8b63e4 |
fail(regex_constants::error_bad_pattern, m_position - m_base);
|
|
Petr Machata |
8b63e4 |
return false;
|
|
Petr Machata |
8b63e4 |
}
|
|
Petr Machata |
8b63e4 |
+ // check for invalid repetition of next state:
|
|
Petr Machata |
8b63e4 |
+ b = this->getaddress(expected_alt_point);
|
|
Petr Machata |
8b63e4 |
+ b = this->getaddress(static_cast<re_alt*>(b)->next.i, b);
|
|
Petr Machata |
8b63e4 |
+ if((b->type != syntax_element_assert_backref)
|
|
Petr Machata |
8b63e4 |
+ && (b->type != syntax_element_startmark))
|
|
Petr Machata |
8b63e4 |
+ {
|
|
Petr Machata |
8b63e4 |
+ fail(regex_constants::error_badrepeat, m_position - m_base);
|
|
Petr Machata |
8b63e4 |
+ return false;
|
|
Petr Machata |
8b63e4 |
+ }
|
|
Petr Machata |
8b63e4 |
}
|
|
Petr Machata |
8b63e4 |
//
|
|
Petr Machata |
8b63e4 |
// append closing parenthesis state:
|