Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#3632 closed Bugs (fixed)

match_results and singular iterator woes with msvc-10.0

Reported by: Eric Niebler Owned by: John Maddock
Milestone: Boost 1.43.0 Component: regex
Version: Boost Development Trunk Severity: Problem
Keywords: regex iterator debugging msvc-10.0 Cc:

Description

Hi John, I just fixed a similar issue in xpressive and thought that it would probably manifest in your lib, too. Sure enough. The msvc-10.0 beta has new iterator debugging that is very strict. The following code causes a crash in match_results::swap:

#include <boost/regex.hpp>

int main()
{
    using namespace boost;
    regex rx("\\w+");
    smatch what0, what1;
    std::string hello("hello");
    if(regex_match(hello, what0, rx))
    {
        what0.swap(what1);
    }
}

The problem is that what1.m_base is a singular iterator at this point. The swap tries to assign from it, which is verboten.

Change History (3)

comment:1 by John Maddock, 13 years ago

Resolution: fixed
Status: newclosed

Sigh... what's really annoying about this is that VC-10 actually appears to be correct in complaining!

Fixed in Trunk.

Thanks for the heads-up, John.

comment:2 by rwebb <richard.webb@…>, 13 years ago

Milestone: Boost 1.41.0Boost 1.43.0
Resolution: fixed
Status: closedreopened
Version: Boost 1.40.0Boost Development Trunk

There still seems to be a problem with this with the release version of VC10 and the current trunk code - the

that.m_base = m_base;

on line 407 of match_results.hpp is crashing in the regex_regress regression test, due to being singular.

comment:3 by John Maddock, 13 years ago

Resolution: fixed
Status: reopenedclosed

(In [61430]) Disambiguate between boost::ref and std:ref etc. Suppress some new warnings from VC-10. Fix singular iterator logic (fixes VC-10 failures). Fixes #4114. Fixes #3632

Note: See TracTickets for help on using tickets.