From: Mike Pall Date: Tue, 27 May 2014 13:58:04 +0000 (+0200) Subject: PPC: Fix red zone overflow in machine code generation. X-Git-Tag: v2.0.4~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49d3157e146bc33b5b7c3a82ce00a8f824f6fa49;p=thirdparty%2FLuaJIT.git PPC: Fix red zone overflow in machine code generation. --- diff --git a/src/lj_asm_ppc.h b/src/lj_asm_ppc.h index e1a496a7..0a3d35e9 100644 --- a/src/lj_asm_ppc.h +++ b/src/lj_asm_ppc.h @@ -49,6 +49,8 @@ static void asm_exitstub_setup(ASMState *as, ExitNo nexits) { ExitNo i; MCode *mxp = as->mctop; + if (mxp - (nexits + 3 + MCLIM_REDZONE) < as->mclim) + asm_mclimit(as); /* 1: mflr r0; bl ->vm_exit_handler; li r0, traceno; bl <1; bl <1; ... */ for (i = nexits-1; (int32_t)i >= 0; i--) *--mxp = PPCI_BL|(((-3-i)&0x00ffffffu)<<2);