MSYS2: Enable unexpected exception handling on clang64

main
Frederik Carlier 2 years ago committed by Frederik Carlier
parent cdd58c4a48
commit 1b95a387e8

@ -209,7 +209,6 @@ jobs:
- msystem: clang64 - msystem: clang64
package-prefix: clang-x86_64 package-prefix: clang-x86_64
cmake-flags: LDFLAGS="-lc++" cmake-flags: LDFLAGS="-lc++"
ctest-flags: -E UnexpectedException*
# Don't abort runners if a single one fails # Don't abort runners if a single one fails
fail-fast: false fail-fast: false
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}

@ -44,7 +44,6 @@ extern "C"
OBJC_PUBLIC OBJC_PUBLIC
void objc_exception_throw(id object) void objc_exception_throw(id object)
{ {
#ifdef __GLIBCXX__
// Don't bother with a mutex here. It doesn't matter if two threads set // Don't bother with a mutex here. It doesn't matter if two threads set
// these values at the same time. // these values at the same time.
if (!done_setup) if (!done_setup)
@ -63,17 +62,12 @@ void objc_exception_throw(id object)
done_setup = true; done_setup = true;
} }
#endif
id *exc = (id *)__cxa_allocate_exception(sizeof(id)); id *exc = (id *)__cxa_allocate_exception(sizeof(id));
*exc = object; *exc = object;
objc_retain(object); objc_retain(object);
DEBUG_LOG("objc_exception_throw: Throwing 0x%x\n", *exc); DEBUG_LOG("objc_exception_throw: Throwing 0x%x\n", *exc);
#ifndef __GLIBCXX__
// At the moment, only libstdc++ exposes __cxa_init_primary_exception.
__cxa_throw(exc, & __objc_id_type_info, eh_cleanup);
#else
__cxa_eh_globals *globals = __cxa_get_globals (); __cxa_eh_globals *globals = __cxa_get_globals ();
globals->uncaughtExceptions += 1; globals->uncaughtExceptions += 1;
__cxa_refcounted_exception *header = __cxa_refcounted_exception *header =
@ -90,7 +84,6 @@ void objc_exception_throw(id object)
} }
DEBUG_LOG("Throw returned %d\n",(int) err); DEBUG_LOG("Throw returned %d\n",(int) err);
abort(); abort();
#endif
} }
OBJC_PUBLIC extern objc_uncaught_exception_handler objc_setUncaughtExceptionHandler(objc_uncaught_exception_handler handler) OBJC_PUBLIC extern objc_uncaught_exception_handler objc_setUncaughtExceptionHandler(objc_uncaught_exception_handler handler)

Loading…
Cancel
Save