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

@ -42,6 +42,12 @@ perl_matcher<BidiIterator, Allocator, traits, Allocator2>::perl_matcher(BidiIter
{
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;
m_match_flags = f;
icase = re.flags() & regex_constants::icase;