diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-02-21 20:59:26 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-02-21 20:59:26 +0000 |
commit | 1989928eb25ddc973220f58fb3db143c57a3ec71 (patch) | |
tree | 6d61b2824699cd8de17a0d01e06990679f06a550 /libstdc++-v3/libsupc++ | |
parent | 667bb867a61a819c6271b3b287efaca22e0f1512 (diff) | |
download | gcc-1989928eb25ddc973220f58fb3db143c57a3ec71.tar.gz |
* libsupc++/vterminate.cc
(__gnu_cxx::__verbose_terminate_handler): Guard against recursive
calls to terminate.
* src/demangle.cc (__cxa_demangle): Wrap in try-catch block.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78235 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/libsupc++')
-rw-r--r-- | libstdc++-v3/libsupc++/vterminate.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libstdc++-v3/libsupc++/vterminate.cc b/libstdc++-v3/libsupc++/vterminate.cc index 38f6f617868..0ec9f2ccfe4 100644 --- a/libstdc++-v3/libsupc++/vterminate.cc +++ b/libstdc++-v3/libsupc++/vterminate.cc @@ -51,6 +51,16 @@ namespace __gnu_cxx stderr. */ void __verbose_terminate_handler() { + static bool terminating; + + if (terminating) + { + writestr ("terminate called recursively\n"); + abort (); + } + + terminating = true; + // Make sure there was an exception; terminate is also called for an // attempt to rethrow when there is no suitable exception. type_info *t = __cxa_current_exception_type(); |