aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2021-06-25 18:31:23 +0100
committerJonathan Wakely <jwakely@redhat.com>2021-06-25 18:47:44 +0100
commit4a52cf2eb9d6864ad85674ab56838e0d9ce27926 (patch)
treec6d5721c0a4ccfbe7c739b5856e70635da9ea805 /gcc
parentf8c5b542f6cb6a947600e34420565ac67486ea14 (diff)
downloadgcc-4a52cf2eb9d6864ad85674ab56838e0d9ce27926.zip
gcc-4a52cf2eb9d6864ad85674ab56838e0d9ce27926.tar.gz
gcc-4a52cf2eb9d6864ad85674ab56838e0d9ce27926.tar.bz2
libstdc++: Avoid intercepting exception in ostream::write
Currently if ostream::write fails and sets badbit and that causes an exception, we will catch the exception, set badbit again, and rethrow the exception. This change delays setting badbit until after the try-catch block, so that if it causes an exception we don't need to catch and rethrow it. This removes the last remaining use of _M_write, so it can be made private (or removed entirely for versioned namespace builds, where ABI compatibility is not required). All other uses of _M_write were replaced by calls to __ostream_insert, so make _M_write use that too. libstdc++-v3/ChangeLog: * include/bits/ostream.tcc (basic_ostream::write): Call sputn directly instead of using _M_write. Do setstate(__err) all outside the try-catch block. * include/std/ostream (basic_ostream::_M_write): Declare private. Use __ostream_insert. Do not define for the versioned namespace.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions