#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 , 13 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:2 by , 13 years ago
| Milestone: | Boost 1.41.0 → Boost 1.43.0 |
|---|---|
| Resolution: | fixed |
| Status: | closed → reopened |
| Version: | Boost 1.40.0 → 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 by , 13 years ago
| Resolution: | → fixed |
|---|---|
| Status: | reopened → 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.