Modify

Ticket #3632 (closed Bugs: fixed)

Opened 4 years ago

Last modified 4 years ago

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

Change History

comment:1 Changed 4 years ago by johnmaddock

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

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

  • Status changed from closed to reopened
  • Version changed from Boost 1.40.0 to Boost Development Trunk
  • Resolution fixed deleted
  • Milestone changed from Boost 1.41.0 to Boost 1.43.0

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 4 years ago by johnmaddock

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

(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

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
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.