ObjFW  Check-in [691290ca0f]

Overview
Comment:runtime: Fix handling C++ exceptions
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 691290ca0f4312ba1842e7624a80bd7d5520b4c5353074f391eea6ee8409d908
User & Date: js on 2024-11-03 23:52:36
Other Links: manifest | tags
Context
2024-11-04
00:10
Fix compiling ObjC++ on Windows check-in: 5e5ca921cb user: js tags: trunk
2024-11-03
23:52
runtime: Fix handling C++ exceptions check-in: 691290ca0f user: js tags: trunk
16:44
Fix compiling for Wii for real check-in: 4f02a0bfcc user: js tags: trunk
Changes

Modified src/runtime/exception.m from [98da1df5a9] to [4a8fb62c93].

233
234
235
236
237
238
239
240

241
242
243
244
245
246
247
233
234
235
236
237
238
239

240
241
242
243
244
245
246
247







-
+







_Unwind_SetIP(struct _Unwind_Context *ctx, uintptr_t value)
{
	uintptr_t thumb = _Unwind_GetGR(ctx, 15) & 1;
	_Unwind_SetGR(ctx, 15, (value | thumb));
}
#endif

#ifdef CXX_PERSONALITY
#ifdef CXX_PERSONALITY_STR
static PERSONALITY_FUNC(cxx_personality) OF_WEAK_REF(CXX_PERSONALITY_STR);
#endif

#ifdef __SEH__
extern EXCEPTION_DISPOSITION _GCC_specific_handler(PEXCEPTION_RECORD, void *,
    PCONTEXT, PDISPATCHER_CONTEXT, _Unwind_Reason_Code (*)(int, int, uint64_t,
    struct _Unwind_Exception *, struct _Unwind_Context *));
611
612
613
614
615
616
617
618

619
620
621
622
623
624
625
611
612
613
614
615
616
617

618
619
620
621
622
623
624
625







-
+







	struct LSDA LSDA;
	uintptr_t landingpad = 0;
	uint8_t found = 0;
	intptr_t filter = 0;

	if (foreign) {
		switch (exClass) {
#ifdef CXX_PERSONALITY
#ifdef CXX_PERSONALITY_STR
		case GNUCCXX0_EXCEPTION_CLASS:
		case CLNGCXX0_EXCEPTION_CLASS:
			if (cxx_personality != NULL)
				return CALL_PERSONALITY(cxx_personality);
			break;
#endif
		}