Merge collected bug fixes from Trunk:

Refs #589.
Refs #7032.
Refs #7084.
Refs #6346.

[SVN r79556]
This commit is contained in:
John Maddock
2012-07-16 08:38:23 +00:00
parent 8aa4a1225a
commit a26d66b688
16 changed files with 64 additions and 10 deletions

View File

@ -191,6 +191,7 @@ void basic_regex_parser<charT, traits>::fail(regex_constants::error_type error_c
this->m_pdata->m_status = error_code;
m_position = m_end; // don't bother parsing anything else
#ifndef BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
//
// Augment error message with the regular expression text:
//
@ -211,6 +212,7 @@ void basic_regex_parser<charT, traits>::fail(regex_constants::error_type error_c
}
message += "'.";
}
#endif
#ifndef BOOST_NO_EXCEPTIONS
if(0 == (this->flags() & regex_constants::no_except))
@ -660,6 +662,11 @@ template <class charT, class traits>
bool basic_regex_parser<charT, traits>::parse_extended_escape()
{
++m_position;
if(m_position == m_end)
{
fail(regex_constants::error_escape, m_position - m_base, "Incomplete escape sequence found.");
return false;
}
bool negate = false; // in case this is a character class escape: \w \d etc
switch(this->m_traits.escape_syntax_type(*m_position))
{
@ -2089,6 +2096,14 @@ insert_recursion:
return false;
}
v = this->m_traits.toi(m_position, m_end, 10);
if(m_position == m_end)
{
// Rewind to start of (? sequence:
--m_position;
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
fail(regex_constants::error_perl_extension, m_position - m_base);
return false;
}
if(*m_position == charT('R'))
{
if(++m_position == m_end)