ObjFW  Diff

Differences From Artifact [b2da8e6383]:

To Artifact [4a94088d13]:


25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

#import "runtime.h"
#import "runtime-private.h"

#import "macros.h"

#if defined(HAVE_DWARF_EXCEPTIONS)
# define PERSONALITY	 __gnu_objc_personality_v0
# define CXX_PERSONALITY __gxx_personality_v0
#elif defined(HAVE_SJLJ_EXCEPTIONS)
# define PERSONALITY	 __gnu_objc_personality_sj0
# define CXX_PERSONALITY __gxx_personality_sj0
# define _Unwind_RaiseException _Unwind_SjLj_RaiseException
# define __builtin_eh_return_data_regno(i) (i)
#elif defined(HAVE_SEH_EXCEPTIONS)
# define PERSONALITY	 gnu_objc_personality
#else
# error Unknown exception type!
#endif







|
|

|
|







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

#import "runtime.h"
#import "runtime-private.h"

#import "macros.h"

#if defined(HAVE_DWARF_EXCEPTIONS)
# define PERSONALITY __gnu_objc_personality_v0
# define CXX_PERSONALITY_STR "__gxx_personality_v0"
#elif defined(HAVE_SJLJ_EXCEPTIONS)
# define PERSONALITY __gnu_objc_personality_sj0
# define CXX_PERSONALITY_STR "__gxx_personality_sj0"
# define _Unwind_RaiseException _Unwind_SjLj_RaiseException
# define __builtin_eh_return_data_regno(i) (i)
#elif defined(HAVE_SEH_EXCEPTIONS)
# define PERSONALITY	 gnu_objc_personality
#else
# error Unknown exception type!
#endif
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
{
	uintptr_t thumb = _Unwind_GetGR(ctx, 15) & 1;
	_Unwind_SetGR(ctx, 15, (value | thumb));
}
#endif

#ifdef CXX_PERSONALITY
extern PERSONALITY_FUNC(CXX_PERSONALITY) __attribute__((__weak__));
#endif

#ifdef HAVE_SEH_EXCEPTIONS
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*));
#endif







|







211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
{
	uintptr_t thumb = _Unwind_GetGR(ctx, 15) & 1;
	_Unwind_SetGR(ctx, 15, (value | thumb));
}
#endif

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

#ifdef HAVE_SEH_EXCEPTIONS
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*));
#endif
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
	intptr_t filter = 0;

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

		/*
		 * None matched or none available - we'll try to handle it
		 * anyway, but will most likely fail.







|
|







566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
	intptr_t filter = 0;

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

		/*
		 * None matched or none available - we'll try to handle it
		 * anyway, but will most likely fail.