diff options
-rw-r--r-- | src/lj_record.c | 9 | ||||
-rw-r--r-- | src/lj_snap.c | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/lj_record.c b/src/lj_record.c index 9e41ce05..46482aa2 100644 --- a/src/lj_record.c +++ b/src/lj_record.c | |||
@@ -571,10 +571,10 @@ static LoopEvent rec_iterl(jit_State *J, const BCIns iterins) | |||
571 | } | 571 | } |
572 | 572 | ||
573 | /* Record LOOP/JLOOP. Now, that was easy. */ | 573 | /* Record LOOP/JLOOP. Now, that was easy. */ |
574 | static LoopEvent rec_loop(jit_State *J, BCReg ra) | 574 | static LoopEvent rec_loop(jit_State *J, BCReg ra, int skip) |
575 | { | 575 | { |
576 | if (ra < J->maxslot) J->maxslot = ra; | 576 | if (ra < J->maxslot) J->maxslot = ra; |
577 | J->pc++; | 577 | J->pc += skip; |
578 | return LOOPEV_ENTER; | 578 | return LOOPEV_ENTER; |
579 | } | 579 | } |
580 | 580 | ||
@@ -2424,7 +2424,7 @@ void lj_record_ins(jit_State *J) | |||
2424 | rec_loop_interp(J, pc, rec_iterl(J, *pc)); | 2424 | rec_loop_interp(J, pc, rec_iterl(J, *pc)); |
2425 | break; | 2425 | break; |
2426 | case BC_LOOP: | 2426 | case BC_LOOP: |
2427 | rec_loop_interp(J, pc, rec_loop(J, ra)); | 2427 | rec_loop_interp(J, pc, rec_loop(J, ra, 1)); |
2428 | break; | 2428 | break; |
2429 | 2429 | ||
2430 | case BC_JFORL: | 2430 | case BC_JFORL: |
@@ -2434,7 +2434,8 @@ void lj_record_ins(jit_State *J) | |||
2434 | rec_loop_jit(J, rc, rec_iterl(J, traceref(J, rc)->startins)); | 2434 | rec_loop_jit(J, rc, rec_iterl(J, traceref(J, rc)->startins)); |
2435 | break; | 2435 | break; |
2436 | case BC_JLOOP: | 2436 | case BC_JLOOP: |
2437 | rec_loop_jit(J, rc, rec_loop(J, ra)); | 2437 | rec_loop_jit(J, rc, rec_loop(J, ra, |
2438 | !bc_isret(bc_op(traceref(J, rc)->startins)))); | ||
2438 | break; | 2439 | break; |
2439 | 2440 | ||
2440 | case BC_IFORL: | 2441 | case BC_IFORL: |
diff --git a/src/lj_snap.c b/src/lj_snap.c index f1358cf2..45e2008f 100644 --- a/src/lj_snap.c +++ b/src/lj_snap.c | |||
@@ -121,6 +121,9 @@ static MSize snapshot_framelinks(jit_State *J, SnapEntry *map, uint8_t *topslot) | |||
121 | MSize f = 0; | 121 | MSize f = 0; |
122 | map[f++] = SNAP_MKPC(J->pc); /* The current PC is always the first entry. */ | 122 | map[f++] = SNAP_MKPC(J->pc); /* The current PC is always the first entry. */ |
123 | #endif | 123 | #endif |
124 | lj_assertJ(!J->pt || | ||
125 | (J->pc >= proto_bc(J->pt) && | ||
126 | J->pc < proto_bc(J->pt) + J->pt->sizebc), "bad snapshot PC"); | ||
124 | while (frame > lim) { /* Backwards traversal of all frames above base. */ | 127 | while (frame > lim) { /* Backwards traversal of all frames above base. */ |
125 | if (frame_islua(frame)) { | 128 | if (frame_islua(frame)) { |
126 | #if !LJ_FR2 | 129 | #if !LJ_FR2 |