diff options
Diffstat (limited to 'libstdc++-v3/libsupc++')
-rw-r--r-- | libstdc++-v3/libsupc++/eh_aux_runtime.cc | 19 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/eh_personality.cc | 2 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/new_op.cc | 9 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/vec.cc | 13 |
4 files changed, 8 insertions, 35 deletions
diff --git a/libstdc++-v3/libsupc++/eh_aux_runtime.cc b/libstdc++-v3/libsupc++/eh_aux_runtime.cc index c6abe354647..0cbce24d316 100644 --- a/libstdc++-v3/libsupc++/eh_aux_runtime.cc +++ b/libstdc++-v3/libsupc++/eh_aux_runtime.cc @@ -1,6 +1,5 @@ // -*- C++ -*- Common throw conditions. -// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2009, 2011 -// Free Software Foundation +// Copyright (C) 1994-2012 Free Software Foundation // // This file is part of GCC. // @@ -31,21 +30,9 @@ extern "C" void __cxxabiv1::__cxa_bad_cast () -{ -#ifdef __EXCEPTIONS - throw std::bad_cast(); -#else - std::abort(); -#endif -} +{ _GLIBCXX_THROW_OR_ABORT(std::bad_cast()); } extern "C" void __cxxabiv1::__cxa_bad_typeid () -{ -#ifdef __EXCEPTIONS - throw std::bad_typeid(); -#else - std::abort(); -#endif -} +{ _GLIBCXX_THROW_OR_ABORT(std::bad_typeid()); } diff --git a/libstdc++-v3/libsupc++/eh_personality.cc b/libstdc++-v3/libsupc++/eh_personality.cc index 72f596e0692..2963c0c584a 100644 --- a/libstdc++-v3/libsupc++/eh_personality.cc +++ b/libstdc++-v3/libsupc++/eh_personality.cc @@ -768,7 +768,7 @@ __cxa_call_unexpected (void *exc_obj_in) if (check_exception_spec (&info, __get_exception_header_from_obj (new_ptr)->exceptionType, new_ptr, xh_switch_value)) - __throw_exception_again; + { __throw_exception_again; } // If the exception spec allows std::bad_exception, throw that. // We don't have a thrown object to compare against, but since diff --git a/libstdc++-v3/libsupc++/new_op.cc b/libstdc++-v3/libsupc++/new_op.cc index bb0199e969e..7366d556fd8 100644 --- a/libstdc++-v3/libsupc++/new_op.cc +++ b/libstdc++-v3/libsupc++/new_op.cc @@ -1,7 +1,6 @@ // Support routines for the -*- C++ -*- dynamic memory management. -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2009, 2011 -// Free Software Foundation +// Copyright (C) 1997-2012 Free Software Foundation // // This file is part of GCC. // @@ -54,11 +53,7 @@ operator new (std::size_t sz) _GLIBCXX_THROW (std::bad_alloc) { new_handler handler = __new_handler; if (! handler) -#ifdef __EXCEPTIONS - throw bad_alloc(); -#else - std::abort(); -#endif + _GLIBCXX_THROW_OR_ABORT(bad_alloc()); handler (); p = (void *) malloc (sz); } diff --git a/libstdc++-v3/libsupc++/vec.cc b/libstdc++-v3/libsupc++/vec.cc index 507514ec76a..04cb3fa6436 100644 --- a/libstdc++-v3/libsupc++/vec.cc +++ b/libstdc++-v3/libsupc++/vec.cc @@ -28,7 +28,6 @@ #include <cxxabi.h> #include <new> #include <exception> -#include <cstdlib> #include <bits/exception_defines.h> #include "unwind-cxx.h" @@ -66,18 +65,10 @@ namespace __cxxabiv1 std::size_t padding_size) { if (element_size && element_count > std::size_t(-1) / element_size) -#ifdef __EXCEPTIONS - throw std::bad_alloc(); -#else - std::abort(); -#endif + _GLIBCXX_THROW_OR_ABORT(std::bad_alloc()); std::size_t size = element_count * element_size; if (size + padding_size < size) -#ifdef __EXCEPTIONS - throw std::bad_alloc(); -#else - std::abort(); -#endif + _GLIBCXX_THROW_OR_ABORT(std::bad_alloc()); return size + padding_size; } } |