Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Misc. cosmetic changes.
[simgrid.git] / src / xbt / exception.cpp
index 8b9c3d3..9fadba9 100644 (file)
@@ -79,7 +79,7 @@ static void show_backtrace(const simgrid::xbt::Backtrace& bt)
 
 static std::terminate_handler previous_terminate_handler = nullptr;
 
-static void handler()
+XBT_ATTRIB_NORETURN static void handler()
 {
   // Avoid doing crazy things if we get an uncaught exception inside an uncaught exception
   static std::atomic_flag lock = ATOMIC_FLAG_INIT;
@@ -88,8 +88,7 @@ static void handler()
     std::abort();
   }
 
-  // Get the current backtrace and exception
-  simgrid::xbt::Backtrace bt = simgrid::xbt::Backtrace();
+  // Get the current exception and show backtrace
   try {
     std::rethrow_exception(std::current_exception());
   }
@@ -120,7 +119,7 @@ static void handler()
     }
     XBT_ERROR("Unknown uncaught exception");
   }
-  show_backtrace(bt);
+  show_backtrace(simgrid::xbt::Backtrace());
   std::abort();
 }