Fix a regression introduced by the fix of libstdc++/68276.
2015-12-18 Ville Voutilainen <ville.voutilainen@gmail.com> Fix a regression introduced by the fix of libstdc++/68276. * src/c++11/ios.cc (_M_grow_words): Catch bad_alloc again so that bad_array_new_length is handled properly. From-SVN: r231839
This commit is contained in:
parent
e8f47b663f
commit
ca2c1b3283
@ -1,3 +1,9 @@
|
||||
2015-12-18 Ville Voutilainen <ville.voutilainen@gmail.com>
|
||||
|
||||
Fix a regression introduced by the fix of libstdc++/68276.
|
||||
* src/c++11/ios.cc (_M_grow_words): Catch bad_alloc again so that
|
||||
bad_array_new_length is handled properly.
|
||||
|
||||
2015-12-18 Ville Voutilainen <ville.voutilainen@gmail.com>
|
||||
|
||||
PR libstdc++/68276
|
||||
|
@ -121,7 +121,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
if (__ix < numeric_limits<int>::max())
|
||||
{
|
||||
__newsize = __ix + 1;
|
||||
__words = new (std::nothrow) _Words[__newsize];
|
||||
/* We still need to catch bad_alloc even though we use
|
||||
a nothrow new, because the new-expression can throw
|
||||
a bad_array_new_length. */
|
||||
__try
|
||||
{ __words = new (std::nothrow) _Words[__newsize]; }
|
||||
__catch(const std::bad_alloc&)
|
||||
{ __words = nullptr; }
|
||||
if (!__words)
|
||||
{
|
||||
_M_streambuf_state |= badbit;
|
||||
|
Loading…
Reference in New Issue
Block a user