Skip to content

Commit

Permalink
Merge branch 'master' into v2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Pall committed Oct 12, 2020
2 parents 4bb2e4a 5c46f47 commit 675e08c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/lj_record.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,10 571,10 @@ static LoopEvent rec_iterl(jit_State *J, const BCIns iterins)
}

/* 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;
J->pc ;
J->pc = skip;
return LOOPEV_ENTER;
}

Expand Down Expand Up @@ -2424,7 2424,7 @@ void lj_record_ins(jit_State *J)
rec_loop_interp(J, pc, rec_iterl(J, *pc));
break;
case BC_LOOP:
rec_loop_interp(J, pc, rec_loop(J, ra));
rec_loop_interp(J, pc, rec_loop(J, ra, 1));
break;

case BC_JFORL:
Expand All @@ -2434,7 2434,8 @@ void lj_record_ins(jit_State *J)
rec_loop_jit(J, rc, rec_iterl(J, traceref(J, rc)->startins));
break;
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;

case BC_IFORL:
Expand Down
3 changes: 3 additions & 0 deletions src/lj_snap.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 121,9 @@ static MSize snapshot_framelinks(jit_State *J, SnapEntry *map, uint8_t *topslot)
MSize f = 0;
map[f ] = SNAP_MKPC(J->pc); /* The current PC is always the first entry. */
#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. */
if (frame_islua(frame)) {
#if !LJ_FR2
Expand Down

0 comments on commit 675e08c

Please sign in to comment.