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
+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
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;