Modify

Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#3632 closed Bugs (fixed)

match_results and singular iterator woes with msvc-10.0

Reported by: eric_niebler Owned by: johnmaddock
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.

Attachments (0)

Change History (3)

comment:1 Changed 8 years ago by johnmaddock

  • Resolution set to fixed
  • Status changed from new to closed

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 Changed 7 years ago by rwebb <richard.webb@…>

  • Milestone changed from Boost 1.41.0 to Boost 1.43.0
  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Version changed from Boost 1.40.0 to Boost 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 Changed 7 years ago by johnmaddock

  • Resolution set to fixed
  • Status changed from reopened to closed

(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

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain johnmaddock.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.