mirror of
https://github.com/boostorg/regex.git
synced 2025-07-17 22:32:09 +02:00
Added check for invalid regular expression in matching code.
[SVN r18777]
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user