Merge branch 'master' into v2.1

This commit is contained in:
Mike Pall 2020-10-12 15:51:31 +02:00
commit 675e08cf06
2 changed files with 8 additions and 4 deletions

View File

@ -571,10 +571,10 @@ static LoopEvent rec_iterl(jit_State *J, const BCIns iterins)
} }
/* Record LOOP/JLOOP. Now, that was easy. */ /* Record LOOP/JLOOP. Now, that was easy. */
static LoopEvent rec_loop(jit_State *J, BCReg ra) static LoopEvent rec_loop(jit_State *J, BCReg ra, int skip)
{ {
if (ra < J->maxslot) J->maxslot = ra; if (ra < J->maxslot) J->maxslot = ra;
J->pc++; J->pc += skip;
return LOOPEV_ENTER; return LOOPEV_ENTER;
} }
@ -2424,7 +2424,7 @@ void lj_record_ins(jit_State *J)
rec_loop_interp(J, pc, rec_iterl(J, *pc)); rec_loop_interp(J, pc, rec_iterl(J, *pc));
break; break;
case BC_LOOP: case BC_LOOP:
rec_loop_interp(J, pc, rec_loop(J, ra)); rec_loop_interp(J, pc, rec_loop(J, ra, 1));
break; break;
case BC_JFORL: case BC_JFORL:
@ -2434,7 +2434,8 @@ void lj_record_ins(jit_State *J)
rec_loop_jit(J, rc, rec_iterl(J, traceref(J, rc)->startins)); rec_loop_jit(J, rc, rec_iterl(J, traceref(J, rc)->startins));
break; break;
case BC_JLOOP: case BC_JLOOP:
rec_loop_jit(J, rc, rec_loop(J, ra)); rec_loop_jit(J, rc, rec_loop(J, ra,
!bc_isret(bc_op(traceref(J, rc)->startins))));
break; break;
case BC_IFORL: case BC_IFORL:

View File

@ -121,6 +121,9 @@ static MSize snapshot_framelinks(jit_State *J, SnapEntry *map, uint8_t *topslot)
MSize f = 0; MSize f = 0;
map[f++] = SNAP_MKPC(J->pc); /* The current PC is always the first entry. */ map[f++] = SNAP_MKPC(J->pc); /* The current PC is always the first entry. */
#endif #endif
lj_assertJ(!J->pt ||
(J->pc >= proto_bc(J->pt) &&
J->pc < proto_bc(J->pt) + J->pt->sizebc), "bad snapshot PC");
while (frame > lim) { /* Backwards traversal of all frames above base. */ while (frame > lim) { /* Backwards traversal of all frames above base. */
if (frame_islua(frame)) { if (frame_islua(frame)) {
#if !LJ_FR2 #if !LJ_FR2