aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2018-05-02 20:04:55 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2018-05-02 20:04:55 +0100
commit85d0fad46932c6ff6cad0d839157c4290a5f6586 (patch)
treedb7f0ac922b90a89aa4e0b2f32f85e5891399070 /gcc
parent006fbbe9526698a7828023b6710acc478b845e18 (diff)
downloadgcc-85d0fad46932c6ff6cad0d839157c4290a5f6586.zip
gcc-85d0fad46932c6ff6cad0d839157c4290a5f6586.tar.gz
gcc-85d0fad46932c6ff6cad0d839157c4290a5f6586.tar.bz2
PR libstdc++/68197 fail on negative iword/pword indices
The suggested resolution of LWG 3083 is to make invalid indices undefined, but we can fairly easily check for them and treat them as errors in the same way as allocation failure. This avoids a segfault or worse, setting an error flag on the stream instead. PR libstdc++/68197 * include/bits/ios_base.h (ios_base::iword, ios_base::pword): Cast indices to unsigned. * src/c++11/ios.cc (ios_base::_M_grow_words): Treat negative indices as failure. Refactor error handling. * testsuite/27_io/ios_base/storage/68197.cc: New. From-SVN: r259854
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions