|
Description
|
The following program fails on assert.
#include <cassert>
#include <sstream>
#include <string>
int main ()
{
typedef std::num_get<char> NumGet;
typedef std::istreambuf_iterator<char> Iter;
std::locale loc;
for (unsigned i = 0; i < 10000; ++i) {
std::string s (i, '0');
s.push_back ('1');
std::istringstream is (s);
std::ios::iostate state = std::ios::goodbit;
long val = 0;
std::use_facet<NumGet> (loc).get (Iter (is), Iter (), is, state, val);
assert (1 == val && std::ios::eofbit == state);
}
return 0;
}
|
The following program fails on assert.
{noformat}
#include <cassert>
#include <sstream>
#include <string>
int main ()
{
typedef std::num_get<char> NumGet;
typedef std::istreambuf_iterator<char> Iter;
std::locale loc;
for (unsigned i = 0; i < 10000; ++i) {
std::string s (i, '0');
s.push_back ('1');
std::istringstream is (s);
std::ios::iostate state = std::ios::goodbit;
long val = 0;
std::use_facet<NumGet> (loc).get (Iter (is), Iter (), is, state, val);
assert (1 == val && std::ios::eofbit == state);
}
return 0;
}
{noformat}
|
|
Fix Version/s
|
|
4.2.1
[ 12312690
]
|