Apply patch from #8476.

Fixes #8476.

[SVN r84015]
This commit is contained in:
John Maddock
2013-04-22 17:29:50 +00:00
parent 3162e5ef22
commit eed2a486c4
3 changed files with 16 additions and 0 deletions

View File

@ -739,13 +739,16 @@ void basic_regex_creator<charT, traits>::fixup_pointers(re_syntax_base* state)
// set the state_id of this repeat: // set the state_id of this repeat:
static_cast<re_repeat*>(state)->state_id = m_repeater_id++; static_cast<re_repeat*>(state)->state_id = m_repeater_id++;
// fall through: // fall through:
BOOST_FALLTHROUGH;
case syntax_element_alt: case syntax_element_alt:
std::memset(static_cast<re_alt*>(state)->_map, 0, sizeof(static_cast<re_alt*>(state)->_map)); std::memset(static_cast<re_alt*>(state)->_map, 0, sizeof(static_cast<re_alt*>(state)->_map));
static_cast<re_alt*>(state)->can_be_null = 0; static_cast<re_alt*>(state)->can_be_null = 0;
// fall through: // fall through:
BOOST_FALLTHROUGH;
case syntax_element_jump: case syntax_element_jump:
static_cast<re_jump*>(state)->alt.p = getaddress(static_cast<re_jump*>(state)->alt.i, state); static_cast<re_jump*>(state)->alt.p = getaddress(static_cast<re_jump*>(state)->alt.i, state);
// fall through again: // fall through again:
BOOST_FALLTHROUGH;
default: default:
if(state->next.i) if(state->next.i)
state->next.p = getaddress(state->next.i, state); state->next.p = getaddress(state->next.i, state);
@ -942,6 +945,7 @@ void basic_regex_creator<charT, traits>::create_startmaps(re_syntax_base* state)
} }
} }
// fall through: // fall through:
BOOST_FALLTHROUGH;
default: default:
state = state->next.p; state = state->next.p;
} }
@ -1154,12 +1158,14 @@ void basic_regex_creator<charT, traits>::create_startmap(re_syntax_base* state,
} }
m_recursion_checks[recursion_sub] = true; m_recursion_checks[recursion_sub] = true;
// fall through, can't handle nested recursion here... // fall through, can't handle nested recursion here...
BOOST_FALLTHROUGH;
} }
case syntax_element_backref: case syntax_element_backref:
// can be null, and any character can match: // can be null, and any character can match:
if(pnull) if(pnull)
*pnull |= mask; *pnull |= mask;
// fall through: // fall through:
BOOST_FALLTHROUGH;
case syntax_element_wild: case syntax_element_wild:
{ {
// can't be null, any character can match: // can't be null, any character can match:
@ -1360,6 +1366,7 @@ void basic_regex_creator<charT, traits>::create_startmap(re_syntax_base* state,
break; break;
} }
// otherwise fall through: // otherwise fall through:
BOOST_FALLTHROUGH;
default: default:
state = state->next.p; state = state->next.p;
} }
@ -1538,6 +1545,7 @@ void basic_regex_creator<charT, traits>::probe_leading_repeat(re_syntax_base* st
if(this->m_has_backrefs == 0) if(this->m_has_backrefs == 0)
static_cast<re_repeat*>(state)->leading = true; static_cast<re_repeat*>(state)->leading = true;
// fall through: // fall through:
BOOST_FALLTHROUGH;
default: default:
return; return;
} }

View File

@ -370,6 +370,7 @@ bool basic_regex_parser<charT, traits>::parse_extended()
return true; return true;
} }
// Otherwise fall through: // Otherwise fall through:
BOOST_FALLTHROUGH;
default: default:
result = parse_literal(); result = parse_literal();
break; break;
@ -624,6 +625,7 @@ bool basic_regex_parser<charT, traits>::parse_basic_escape()
case 'w': case 'w':
negate = false; negate = false;
// fall through: // fall through:
BOOST_FALLTHROUGH;
case 'W': case 'W':
{ {
basic_char_set<charT, traits> char_set; basic_char_set<charT, traits> char_set;
@ -641,6 +643,7 @@ bool basic_regex_parser<charT, traits>::parse_basic_escape()
case 's': case 's':
negate = false; negate = false;
// fall through: // fall through:
BOOST_FALLTHROUGH;
case 'S': case 'S':
return add_emacs_code(negate); return add_emacs_code(negate);
case 'c': case 'c':
@ -673,6 +676,7 @@ bool basic_regex_parser<charT, traits>::parse_extended_escape()
case regex_constants::escape_type_not_class: case regex_constants::escape_type_not_class:
negate = true; negate = true;
// fall through: // fall through:
BOOST_FALLTHROUGH;
case regex_constants::escape_type_class: case regex_constants::escape_type_class:
{ {
escape_type_class_jump: escape_type_class_jump:
@ -743,6 +747,7 @@ escape_type_class_jump:
case regex_constants::escape_type_not_property: case regex_constants::escape_type_not_property:
negate = true; negate = true;
// fall through: // fall through:
BOOST_FALLTHROUGH;
case regex_constants::escape_type_property: case regex_constants::escape_type_property:
{ {
++m_position; ++m_position;
@ -1960,6 +1965,7 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension()
case regex_constants::syntax_or: case regex_constants::syntax_or:
m_mark_reset = m_mark_count; m_mark_reset = m_mark_count;
// fall through: // fall through:
BOOST_FALLTHROUGH;
case regex_constants::syntax_colon: case regex_constants::syntax_colon:
// //
// a non-capturing mark: // a non-capturing mark:

View File

@ -284,6 +284,7 @@ void basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::format
break; break;
} }
// fall through, not a special character: // fall through, not a special character:
BOOST_FALLTHROUGH;
default: default:
put(*m_position); put(*m_position);
++m_position; ++m_position;
@ -355,6 +356,7 @@ void basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::format
have_brace = true; have_brace = true;
++m_position; ++m_position;
// fall through.... // fall through....
BOOST_FALLTHROUGH;
default: default:
// see if we have a number: // see if we have a number:
{ {