Skip to content

Commit

Permalink
rt: Support SEH/SJLJ personality routine
Browse files Browse the repository at this point in the history
  • Loading branch information
klutzy committed Aug 26, 2013
1 parent ef20bd4 commit 63e53b8
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/rt/rust_upcall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,18 @@ upcall_call_shim_on_rust_stack(void *args, void *fn_ptr) {

/**********************************************************************/

#ifdef __SEH__
# define PERSONALITY_FUNC __gxx_personality_seh0
#else
# ifdef __USING_SJLJ_EXCEPTIONS__
# define PERSONALITY_FUNC __gxx_personality_sjlj
# else
# define PERSONALITY_FUNC __gxx_personality_v0
# endif
#endif

extern "C" _Unwind_Reason_Code
__gxx_personality_v0(int version,
PERSONALITY_FUNC(int version,
_Unwind_Action actions,
uint64_t exception_class,
_Unwind_Exception *ue_header,
Expand All @@ -72,11 +82,11 @@ struct s_rust_personality_args {

extern "C" void
upcall_s_rust_personality(s_rust_personality_args *args) {
args->retval = __gxx_personality_v0(args->version,
args->actions,
args->exception_class,
args->ue_header,
args->context);
args->retval = PERSONALITY_FUNC(args->version,
args->actions,
args->exception_class,
args->ue_header,
args->context);
}

/**
Expand Down

0 comments on commit 63e53b8

Please sign in to comment.