Tighten up error handling and checking.

[SVN r57133]
This commit is contained in:
John Maddock
2009-10-24 15:51:57 +00:00
parent 17ad2e9302
commit 9188464e39
2 changed files with 6 additions and 0 deletions

View File

@ -141,6 +141,11 @@ void basic_regex_parser<charT, traits>::parse(const charT* p1, const charT* p2,
case regbase::literal:
m_parser_proc = &basic_regex_parser<charT, traits>::parse_literal;
break;
default:
// Ooops, someone has managed to set more than one of the main option flags,
// so this must be an error:
fail(regex_constants::error_unknown, 0);
return;
}
// parse all our characters:

View File

@ -411,6 +411,7 @@ public:
}
void BOOST_REGEX_CALL set_first(BidiIterator i)
{
BOOST_ASSERT(m_subs.size() > 2);
// set up prefix:
m_subs[1].second = i;
m_subs[1].matched = (m_subs[1].first != i);