mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
x64: Workaround for libgcc unwind bug (still present in RHEL 5.5).
This commit is contained in:
parent
6299485000
commit
ac3b1dcfc5
2261
src/buildvm_x64.h
2261
src/buildvm_x64.h
File diff suppressed because it is too large
Load Diff
2116
src/buildvm_x64win.h
2116
src/buildvm_x64win.h
File diff suppressed because it is too large
Load Diff
@ -530,6 +530,14 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse)
|
||||
| mov dword GL:RB->vmstate, ~LJ_VMST_C
|
||||
| jmp ->vm_leave_unw
|
||||
|
|
||||
|->vm_unwind_rethrow:
|
||||
|.if X64 and not X64WIN
|
||||
| mov FCARG1, SAVE_L
|
||||
| mov FCARG2, eax
|
||||
| restoreregs
|
||||
| jmp extern lj_err_throw@8 // (lua_State *L, int errcode)
|
||||
|.endif
|
||||
|
|
||||
|->vm_unwind_ff@4: // Unwind C stack, return from ff pcall.
|
||||
| // (void *cframe)
|
||||
|.if X64
|
||||
|
2324
src/buildvm_x86.h
2324
src/buildvm_x86.h
File diff suppressed because it is too large
Load Diff
10
src/lj_err.c
10
src/lj_err.c
@ -577,6 +577,16 @@ LJ_FUNCA int lj_err_unwind_dwarf(int version, _Unwind_Action actions,
|
||||
lj_vm_unwind_c_eh));
|
||||
return _URC_INSTALL_CONTEXT;
|
||||
}
|
||||
#if LJ_TARGET_X86ORX64
|
||||
else if ((actions & _UA_HANDLER_FRAME)) {
|
||||
/* Workaround for ancient libgcc bug. Still present in RHEL 5.5. :-/
|
||||
** Real fix: http://gcc.gnu.org/viewcvs/trunk/gcc/unwind-dw2.c?r1=121165&r2=124837&pathrev=153877&diff_format=h
|
||||
*/
|
||||
_Unwind_SetGR(ctx, LJ_TARGET_EHRETREG, errcode);
|
||||
_Unwind_SetIP(ctx, (_Unwind_Ptr)lj_vm_unwind_rethrow);
|
||||
return _URC_INSTALL_CONTEXT;
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
/* This is not the proper way to escape from the unwinder. We get away with
|
||||
** it on x86/PPC because the interpreter restores all callee-saved regs.
|
||||
|
@ -19,6 +19,9 @@ LJ_ASMF_NORET void LJ_FASTCALL lj_vm_unwind_c(void *cframe, int errcode);
|
||||
LJ_ASMF_NORET void LJ_FASTCALL lj_vm_unwind_ff(void *cframe);
|
||||
LJ_ASMF void lj_vm_unwind_c_eh(void);
|
||||
LJ_ASMF void lj_vm_unwind_ff_eh(void);
|
||||
#if LJ_TARGET_X86ORX64
|
||||
LJ_ASMF void lj_vm_unwind_rethrow(void);
|
||||
#endif
|
||||
|
||||
/* Miscellaneous functions. */
|
||||
#if LJ_TARGET_X86ORX64
|
||||
|
Loading…
Reference in New Issue
Block a user