Opened 6 years ago

Closed 6 years ago

#12705 closed Bugs (worksforme)

wsregex_iterator construction failed

Reported by: shen_jun_hua@… Owned by: John Maddock
Milestone: To Be Determined Component: regex
Version: Boost 1.58.0 Severity: Problem
Keywords: Cc:

Description

code segment:

std::wstring str = L"value(\"@methodSubType\", $method) =\"场地平整\""; static wregex blankPattern(L"
s+"); wsregex_iterator spaceIter(begin, end, blankPattern);

call stack:

3.regex_iterator_implementation(const regex_type* p, BidirectionalIterator last, match_flag_type f)

: base(), end(last), re(*p), flags(f){}

2.regex_iterator(BidirectionalIterator a, BidirectionalIterator b,

const regex_type& re, match_flag_type m = match_default) : pdata(new impl(&re, b, m))

1.wsregex_iterator spaceIter(begin, end, blankPattern);

in regex_iterator_implementation, variable re init failed.the m_px of re is 0. this problem presents sometimes.

Change History (2)

comment:1 by John Maddock, 6 years ago

You will need to provide a complete, self contained test case for me to investigate.

However, this looks like it might be the usual C++ order-of-initialization issue, which is to say, I suspect you are constructing the regex_iterator in progam startup code before the static regex instance is constructed.

comment:2 by John Maddock, 6 years ago

Resolution: worksforme
Status: newclosed

Please reopen if you can provide a test case.

Note: See TracTickets for help on using tickets.