Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57133 - trunk/boost/regex/v4
From: john_at_[hidden]
Date: 2009-10-24 11:51:58


Author: johnmaddock
Date: 2009-10-24 11:51:57 EDT (Sat, 24 Oct 2009)
New Revision: 57133
URL: http://svn.boost.org/trac/boost/changeset/57133

Log:
Tighten up error handling and checking.
Text files modified:
   trunk/boost/regex/v4/basic_regex_parser.hpp | 5 +++++
   trunk/boost/regex/v4/match_results.hpp | 1 +
   2 files changed, 6 insertions(+), 0 deletions(-)

Modified: trunk/boost/regex/v4/basic_regex_parser.hpp
==============================================================================
--- trunk/boost/regex/v4/basic_regex_parser.hpp (original)
+++ trunk/boost/regex/v4/basic_regex_parser.hpp 2009-10-24 11:51:57 EDT (Sat, 24 Oct 2009)
@@ -141,6 +141,11 @@
    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:

Modified: trunk/boost/regex/v4/match_results.hpp
==============================================================================
--- trunk/boost/regex/v4/match_results.hpp (original)
+++ trunk/boost/regex/v4/match_results.hpp 2009-10-24 11:51:57 EDT (Sat, 24 Oct 2009)
@@ -411,6 +411,7 @@
    }
    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);


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk