From c524ed5dc901a48ddc5a0dd7a0b859d2d44e635e Mon Sep 17 00:00:00 2001 From: Jerry Quinn Date: Wed, 5 Mar 2003 03:01:42 +0000 Subject: [PATCH] ios.cc (ios_base::_M_grow_words): Don't delete _M_word on new failure. 2003-03-04 Jerry Quinn * src/ios.cc (ios_base::_M_grow_words): Don't delete _M_word on new failure. Throw exception if badbit and exception mask when ix >= numeric_limits::max(). From-SVN: r63824 --- libstdc++-v3/ChangeLog | 6 ++++++ libstdc++-v3/src/ios.cc | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 4ada08799e3..67fbed7e274 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2003-03-04 Jerry Quinn + + * src/ios.cc (ios_base::_M_grow_words): Don't delete _M_word on + new failure. Throw exception if badbit and exception mask when ix + >= numeric_limits::max(). + 2003-03-04 Alexandre Oliva * src/strstream.cc (strstreambuf::overflow): Make sure operands of diff --git a/libstdc++-v3/src/ios.cc b/libstdc++-v3/src/ios.cc index 9de6d1309f9..871e836ae9e 100644 --- a/libstdc++-v3/src/ios.cc +++ b/libstdc++-v3/src/ios.cc @@ -253,8 +253,6 @@ namespace std { words = new _Words[newsize]; } catch (...) { - delete [] _M_word; - _M_word = 0; _M_streambuf_state |= badbit; if (_M_streambuf_state & _M_exception) __throw_ios_failure("ios_base::_M_grow_words failure"); @@ -271,6 +269,8 @@ namespace std else { _M_streambuf_state |= badbit; + if (_M_streambuf_state & _M_exception) + __throw_ios_failure("ios_base::_M_grow_words failure"); return _M_word_zero; } }