@@ -316,35 +316,33 @@ static void bt_terminate_handler() {
316
316
__cxa_eh_globals* globals = __cxa_get_globals ();
317
317
__cxa_exception* thrown_exception = globals->caughtExceptions ;
318
318
319
- if (!thrown_exception) {
320
- abort ();
321
- }
322
-
323
- fprintf (stderr, " uncaught exception:\n address -> %p\n " , (void *)thrown_exception);
324
- thrown_exception = realExceptionFromException (thrown_exception);
319
+ if (thrown_exception) {
320
+ fprintf (stderr, " uncaught exception:\n address -> %p\n " , (void *)thrown_exception);
321
+ thrown_exception = realExceptionFromException (thrown_exception);
325
322
326
- const __class_type_info *e_ti = static_cast <const __class_type_info*>(&typeid (std::exception ));
327
- const __class_type_info *throw_ti = dynamic_cast <const __class_type_info*>(thrown_exception->exceptionType );
323
+ const __class_type_info *e_ti = static_cast <const __class_type_info*>(&typeid (std::exception ));
324
+ const __class_type_info *throw_ti = dynamic_cast <const __class_type_info*>(thrown_exception->exceptionType );
328
325
329
- if (throw_ti) {
330
- void * ptr = thrown_exception + 1 ;
326
+ if (throw_ti) {
327
+ void * ptr = thrown_exception + 1 ;
331
328
332
- if (throw_ti->__do_upcast (e_ti, &ptr)) {
333
- std::exception * e = static_cast <std::exception *>(ptr);
329
+ if (throw_ti->__do_upcast (e_ti, &ptr)) {
330
+ std::exception * e = static_cast <std::exception *>(ptr);
334
331
335
- if (e) {
336
- fprintf (stderr, " what() -> \" %s\"\n " , e->what ());
337
- }
338
- }
339
- }
332
+ if (e) {
333
+ fprintf (stderr, " what() -> \" %s\"\n " , e->what ());
334
+ }
335
+ }
336
+ }
340
337
341
- size_t bufferSize = 128 ;
342
- char *demangled = static_cast <char *>(malloc (bufferSize));
343
- const char *mangled = thrown_exception->exceptionType ->name ();
344
- int status;
345
- demangled = __cxa_demangle (mangled, demangled, &bufferSize, &status);
346
- fprintf (stderr, " type -> %s\n " , status == 0 ? demangled : mangled);
347
- if (status == 0 ) { free (demangled); }
338
+ size_t bufferSize = 128 ;
339
+ char *demangled = static_cast <char *>(malloc (bufferSize));
340
+ const char *mangled = thrown_exception->exceptionType ->name ();
341
+ int status;
342
+ demangled = __cxa_demangle (mangled, demangled, &bufferSize, &status);
343
+ fprintf (stderr, " type -> %s\n " , status == 0 ? demangled : mangled);
344
+ if (status == 0 ) { free (demangled); }
345
+ }
348
346
abort ();
349
347
}
350
348
0 commit comments