File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 2626
2727#include < unwind.h>
2828
29+ #include " swift/Runtime/Debug.h"
2930#include " swift/Runtime/Exception.h"
3031
3132using namespace swift ;
@@ -39,11 +40,17 @@ _swift_exceptionPersonality(int version,
3940 struct _Unwind_Exception *exceptionObject,
4041 struct _Unwind_Context *context)
4142{
43+ #if __cpp_exceptions
4244 // Handle exceptions by catching them and calling std::terminate().
4345 // This, in turn, will trigger the unhandled exception routine in the
4446 // C++ runtime.
4547 __cxa_begin_catch (exceptionObject);
4648 std::terminate ();
49+ #else
50+ fatalError (0 ,
51+ " C++ exception handling detected but the Swift runtime was "
52+ " compiled with exceptions disabled\n " );
53+ #endif
4754
4855 return _URC_FATAL_PHASE1_ERROR;
4956}
You can’t perform that action at this time.
0 commit comments