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 26
26
27
27
#include < unwind.h>
28
28
29
+ #include " swift/Runtime/Debug.h"
29
30
#include " swift/Runtime/Exception.h"
30
31
31
32
using namespace swift ;
@@ -39,11 +40,17 @@ _swift_exceptionPersonality(int version,
39
40
struct _Unwind_Exception *exceptionObject,
40
41
struct _Unwind_Context *context)
41
42
{
43
+ #if __cpp_exceptions
42
44
// Handle exceptions by catching them and calling std::terminate().
43
45
// This, in turn, will trigger the unhandled exception routine in the
44
46
// C++ runtime.
45
47
__cxa_begin_catch (exceptionObject);
46
48
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
47
54
48
55
return _URC_FATAL_PHASE1_ERROR;
49
56
}
You can’t perform that action at this time.
0 commit comments