Added check for invalid regular expression in matching code.

[SVN r18777]
This commit is contained in:
John Maddock
2003-06-11 12:11:17 +00:00
parent 13769e4fff
commit ed48905c5e

View File

@ -41,7 +41,13 @@ perl_matcher<BidiIterator, Allocator, traits, Allocator2>::perl_matcher(BidiIter
next_count(&rep_obj), rep_obj(&next_count) next_count(&rep_obj), rep_obj(&next_count)
{ {
typedef typename regex_iterator_traits<BidiIterator>::iterator_category category; typedef typename regex_iterator_traits<BidiIterator>::iterator_category category;
if(e.empty())
{
// precondition failure: e is not a valid regex.
std::invalid_argument ex("Invalid regular expression object");
boost::throw_exception(ex);
}
pstate = 0; pstate = 0;
m_match_flags = f; m_match_flags = f;
icase = re.flags() & regex_constants::icase; icase = re.flags() & regex_constants::icase;