[Bug libstdc++/78236] regex_iterator constructor is incomplete and creates uninitialized values that may be used
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu May 18 15:32:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78236
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Thu May 18 15:30:42 2017
New Revision: 248230
URL: https://gcc.gnu.org/viewcvs?rev=248230&root=gcc&view=rev
Log:
libstdc++/78236 fix past-the-end std::regex_iterator
Backport from mainline
2016-11-09 Tim Shen <timshen@google.com>
PR libstdc++/78236
* libstdc++-v3/include/bits/regex.h (regex_iterator::regex_iterator()):
Define end() as _M_pregex == nullptr.
* libstdc++-v3/include/bits/regex.tcc (regex_iterator::operator==(),
regex_iterator::operator++()): Fix operator==() and operator++() to
look at null-ness of _M_pregex on both sides.
* testsuite/28_regex/regression.cc: New testcase.
Modified:
branches/gcc-5-branch/libstdc++-v3/ChangeLog
branches/gcc-5-branch/libstdc++-v3/include/bits/regex.h
branches/gcc-5-branch/libstdc++-v3/include/bits/regex.tcc
branches/gcc-5-branch/libstdc++-v3/testsuite/28_regex/regression.cc
More information about the Gcc-bugs
mailing list