mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-08 07:34:07 +00:00
ARM: Fix stack check for spilled BASE in parent.
This commit is contained in:
parent
2591b4524a
commit
60b8e9e2fb
@ -1422,8 +1422,9 @@ static void asm_stack_check(ASMState *as, BCReg topslot,
|
|||||||
Reg pbase;
|
Reg pbase;
|
||||||
uint32_t k;
|
uint32_t k;
|
||||||
if (irp) {
|
if (irp) {
|
||||||
if (ra_hasreg(irp->r)) {
|
if (!ra_hasspill(irp->s)) {
|
||||||
pbase = irp->r;
|
pbase = irp->r;
|
||||||
|
lua_assert(ra_hasreg(pbase));
|
||||||
} else if (allow) {
|
} else if (allow) {
|
||||||
pbase = rset_pickbot(allow);
|
pbase = rset_pickbot(allow);
|
||||||
} else {
|
} else {
|
||||||
@ -1442,14 +1443,11 @@ static void asm_stack_check(ASMState *as, BCReg topslot,
|
|||||||
(int32_t)offsetof(lua_State, maxstack));
|
(int32_t)offsetof(lua_State, maxstack));
|
||||||
if (irp) { /* Must not spill arbitrary registers in head of side trace. */
|
if (irp) { /* Must not spill arbitrary registers in head of side trace. */
|
||||||
int32_t i = i32ptr(&J2G(as->J)->jit_L);
|
int32_t i = i32ptr(&J2G(as->J)->jit_L);
|
||||||
if (ra_noreg(irp->r)) {
|
if (ra_hasspill(irp->s))
|
||||||
lua_assert(ra_hasspill(irp->s));
|
emit_lso(as, ARMI_LDR, pbase, RID_SP, sps_scale(irp->s));
|
||||||
emit_lso(as, ARMI_LDR, RID_RET, RID_SP, sps_scale(irp->s));
|
|
||||||
}
|
|
||||||
emit_lso(as, ARMI_LDR, RID_TMP, RID_TMP, (i & 4095));
|
emit_lso(as, ARMI_LDR, RID_TMP, RID_TMP, (i & 4095));
|
||||||
if (ra_noreg(irp->r)) {
|
if (ra_hasspill(irp->s) && !allow)
|
||||||
emit_lso(as, ARMI_STR, RID_RET, RID_SP, 0); /* Save temp. register. */
|
emit_lso(as, ARMI_STR, RID_RET, RID_SP, 0); /* Save temp. register. */
|
||||||
}
|
|
||||||
emit_loadi(as, RID_TMP, (i & ~4095));
|
emit_loadi(as, RID_TMP, (i & ~4095));
|
||||||
} else {
|
} else {
|
||||||
emit_getgl(as, RID_TMP, jit_L);
|
emit_getgl(as, RID_TMP, jit_L);
|
||||||
|
Loading…
Reference in New Issue
Block a user