ios.cc (ios_base::_M_grow_words): Don't delete _M_word on new failure.
authorJerry Quinn <jlquinn@optonline.net>
Wed, 5 Mar 2003 03:01:42 +0000 (03:01 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Wed, 5 Mar 2003 03:01:42 +0000 (03:01 +0000)
2003-03-04  Jerry Quinn  <jlquinn@optonline.net>

* 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<int>::max().

From-SVN: r63824

libstdc++-v3/ChangeLog
libstdc++-v3/src/ios.cc

index 4ada08799e371a01e8f151aa97a7330f383447a1..67fbed7e2747b175ae5e043a48e5973fcd6997f9 100644 (file)
@@ -1,3 +1,9 @@
+2003-03-04  Jerry Quinn  <jlquinn@optonline.net>
+
+       * 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<int>::max().
+
 2003-03-04  Alexandre Oliva  <aoliva@redhat.com>
 
        * src/strstream.cc (strstreambuf::overflow): Make sure operands of
index 9de6d1309f922c1d86e6a94e397c74f68a541de3..871e836ae9e72fe6cecbc51dbcef8867ddaaba85 100644 (file)
@@ -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;
          }
       }