Commit c524ed5d by Jerry Quinn Committed by Benjamin Kosnik

ios.cc (ios_base::_M_grow_words): Don't delete _M_word on new failure.


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
parent 3aa83176
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> 2003-03-04 Alexandre Oliva <aoliva@redhat.com>
* src/strstream.cc (strstreambuf::overflow): Make sure operands of * src/strstream.cc (strstreambuf::overflow): Make sure operands of
......
...@@ -253,8 +253,6 @@ namespace std ...@@ -253,8 +253,6 @@ namespace std
{ words = new _Words[newsize]; } { words = new _Words[newsize]; }
catch (...) catch (...)
{ {
delete [] _M_word;
_M_word = 0;
_M_streambuf_state |= badbit; _M_streambuf_state |= badbit;
if (_M_streambuf_state & _M_exception) if (_M_streambuf_state & _M_exception)
__throw_ios_failure("ios_base::_M_grow_words failure"); __throw_ios_failure("ios_base::_M_grow_words failure");
...@@ -271,6 +269,8 @@ namespace std ...@@ -271,6 +269,8 @@ namespace std
else else
{ {
_M_streambuf_state |= badbit; _M_streambuf_state |= badbit;
if (_M_streambuf_state & _M_exception)
__throw_ios_failure("ios_base::_M_grow_words failure");
return _M_word_zero; return _M_word_zero;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment