Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix static initialization order fiasco reported by fbinfer.
[simgrid.git] / src / xbt / exception.cpp
index de0c748bf5e674d843754c73fb7ef0d484940ab8..bccfd6d4d3e12f5f33a74cc8b0759973f015b34a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2005-2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2005-2021. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -89,10 +89,9 @@ static void handler()
   }
 
   // Get the current backtrace and exception
-  auto e = std::current_exception();
   simgrid::xbt::Backtrace bt = simgrid::xbt::Backtrace();
   try {
-    std::rethrow_exception(e);
+    std::rethrow_exception(std::current_exception());
   }
 
   // Parse error are handled differently, as the call stack does not matter, only the file location