aboutsummaryrefslogtreecommitdiff
path: root/src/lj_snap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_snap.c')
-rw-r--r--src/lj_snap.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lj_snap.c b/src/lj_snap.c
index e29b5357..a2025d88 100644
--- a/src/lj_snap.c
+++ b/src/lj_snap.c
@@ -118,7 +118,6 @@ static void snapshot_stack(jit_State *J, SnapShot *snap, MSize nsnapmap)
118 snap->mapofs = (uint16_t)nsnapmap; 118 snap->mapofs = (uint16_t)nsnapmap;
119 snap->ref = (IRRef1)J->cur.nins; 119 snap->ref = (IRRef1)J->cur.nins;
120 snap->nent = (uint8_t)nent; 120 snap->nent = (uint8_t)nent;
121 snap->depth = (uint8_t)J->framedepth;
122 snap->nslots = (uint8_t)nslots; 121 snap->nslots = (uint8_t)nslots;
123 snap->count = 0; 122 snap->count = 0;
124 J->cur.nsnapmap = (uint16_t)(nsnapmap + nent + 1 + J->framedepth); 123 J->cur.nsnapmap = (uint16_t)(nsnapmap + nent + 1 + J->framedepth);
@@ -274,7 +273,7 @@ void lj_snap_shrink(jit_State *J)
274 map[m++] = map[n]; /* Only copy used slots. */ 273 map[m++] = map[n]; /* Only copy used slots. */
275 } 274 }
276 snap->nent = (uint8_t)m; 275 snap->nent = (uint8_t)m;
277 nlim = nent + snap->depth; 276 nlim = J->cur.nsnapmap - snap->mapofs - 1;
278 while (n <= nlim) map[m++] = map[n++]; /* Move PC + frame links down. */ 277 while (n <= nlim) map[m++] = map[n++]; /* Move PC + frame links down. */
279 J->cur.nsnapmap = (uint16_t)(snap->mapofs + m); /* Free up space in map. */ 278 J->cur.nsnapmap = (uint16_t)(snap->mapofs + m); /* Free up space in map. */
280} 279}
@@ -337,7 +336,7 @@ const BCIns *lj_snap_restore(jit_State *J, void *exptr)
337 SnapShot *snap = &T->snap[snapno]; 336 SnapShot *snap = &T->snap[snapno];
338 MSize n, nent = snap->nent; 337 MSize n, nent = snap->nent;
339 SnapEntry *map = &T->snapmap[snap->mapofs]; 338 SnapEntry *map = &T->snapmap[snap->mapofs];
340 SnapEntry *flinks = map + nent + snap->depth; 339 SnapEntry *flinks = &T->snapmap[snap_nextofs(T, snap)-1];
341 int32_t ftsz0; 340 int32_t ftsz0;
342 BCReg nslots = snap->nslots; 341 BCReg nslots = snap->nslots;
343 TValue *frame; 342 TValue *frame;