This commit is contained in:
Miku AuahDark
2023-01-30 20:58:40 +08:00
parent 7edff04925
commit f587c9d0a8
47 changed files with 142 additions and 100 deletions
+5 -4
View File
@@ -1945,6 +1945,8 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults)
} else if (dst + nresults > J->maxslot) {
J->maxslot = dst + (BCReg)nresults;
}
if (J->baseslot + J->maxslot >= LJ_MAX_JSLOTS)
lj_trace_err(J, LJ_TRERR_STACKOV);
for (i = 0; i < nresults; i++)
J->base[dst+i] = i < nvararg ? getslot(J, i - nvararg - 1 - LJ_FR2) : TREF_NIL;
} else { /* Unknown number of varargs passed to trace. */
@@ -1964,7 +1966,7 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults)
vbase = emitir(IRT(IR_ADD, IRT_PGC), vbase, lj_ir_kint(J, frofs-8*(1+LJ_FR2)));
for (i = 0; i < nload; i++) {
IRType t = itype2irt(&J->L->base[i-1-LJ_FR2-nvararg]);
J->base[dst+i] = lj_record_vload(J, vbase, i, t);
J->base[dst+i] = lj_record_vload(J, vbase, (MSize)i, t);
}
} else {
emitir(IRTGI(IR_LE), fr, lj_ir_kint(J, frofs));
@@ -2022,8 +2024,6 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults)
lj_trace_err_info(J, LJ_TRERR_NYIBC);
}
}
if (J->baseslot + J->maxslot >= LJ_MAX_JSLOTS)
lj_trace_err(J, LJ_TRERR_STACKOV);
}
/* -- Record allocations -------------------------------------------------- */
@@ -2572,7 +2572,8 @@ void lj_record_ins(jit_State *J)
break;
case BC_JLOOP:
rec_loop_jit(J, rc, rec_loop(J, ra,
!bc_isret(bc_op(traceref(J, rc)->startins))));
!bc_isret(bc_op(traceref(J, rc)->startins)) &&
bc_op(traceref(J, rc)->startins) != BC_ITERN));
break;
case BC_IFORL: