(Hopefully) fix C++ exception interop on ARM.

main
David Chisnall 10 years ago
parent 77df8d3d92
commit 42b78dba9b

@ -258,6 +258,10 @@ static inline struct dwarf_eh_lsda parse_lsda(struct _Unwind_Context *context, u
//lsda.type_table = (uintptr_t*)(data + v); //lsda.type_table = (uintptr_t*)(data + v);
} }
#if defined(__arm__) && !defined(__ARM_DWARF_EH__)
lsda.type_table_encoding = (DW_EH_PE_pcrel | DW_EH_PE_indirect);
#endif
lsda.callsite_encoding = (enum dwarf_data_encoding)(*(data++)); lsda.callsite_encoding = (enum dwarf_data_encoding)(*(data++));
// Action table is immediately after the call site table // Action table is immediately after the call site table

@ -486,8 +486,7 @@ BEGIN_PERSONALITY_FUNCTION(__gnustep_objc_personality_v0)
return internal_objc_personality(version, actions, exceptionClass, return internal_objc_personality(version, actions, exceptionClass,
exceptionObject, context, YES); exceptionObject, context, YES);
} }
// FIXME!
#ifndef __arm__
BEGIN_PERSONALITY_FUNCTION(__gnustep_objcxx_personality_v0) BEGIN_PERSONALITY_FUNCTION(__gnustep_objcxx_personality_v0)
if (exceptionClass == objc_exception_class) if (exceptionClass == objc_exception_class)
{ {
@ -497,17 +496,15 @@ BEGIN_PERSONALITY_FUNCTION(__gnustep_objcxx_personality_v0)
id *newEx = __cxa_allocate_exception(sizeof(id)); id *newEx = __cxa_allocate_exception(sizeof(id));
*newEx = ex->object; *newEx = ex->object;
ex->cxx_exception = objc_init_cxx_exception(newEx); ex->cxx_exception = objc_init_cxx_exception(newEx);
memcpy(ex->cxx_exception, exceptionObject, sizeof(struct _Unwind_Exception));
ex->cxx_exception->exception_class = cxx_exception_class; ex->cxx_exception->exception_class = cxx_exception_class;
ex->cxx_exception->exception_cleanup = cleanup; ex->cxx_exception->exception_cleanup = cleanup;
ex->cxx_exception->private_1 = exceptionObject->private_1;
ex->cxx_exception->private_2 = exceptionObject->private_2;
} }
exceptionObject = ex->cxx_exception; exceptionObject = ex->cxx_exception;
exceptionClass = cxx_exception_class; exceptionClass = cxx_exception_class;
} }
return CALL_PERSONALITY_FUNCTION(__gxx_personality_v0); return CALL_PERSONALITY_FUNCTION(__gxx_personality_v0);
} }
#endif
// Weak references to C++ runtime functions. We don't bother testing that // Weak references to C++ runtime functions. We don't bother testing that
// these are 0 before calling them, because if they are not resolved then we // these are 0 before calling them, because if they are not resolved then we

Loading…
Cancel
Save