]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Fix top slot calculation for snapshots with continuations.
authorMike Pall <mike>
Thu, 3 Apr 2014 19:45:57 +0000 (21:45 +0200)
committerMike Pall <mike>
Thu, 3 Apr 2014 19:45:57 +0000 (21:45 +0200)
src/lj_snap.c

index 1c978c26a9a03d47d8bef60c73a9b6ccaac34723..803533cd76b4e8547d712f928573c874b05e9aef 100644 (file)
@@ -104,8 +104,6 @@ static BCReg snapshot_framelinks(jit_State *J, SnapEntry *map)
     if (frame_islua(frame)) {
       map[f++] = SNAP_MKPC(frame_pc(frame));
       frame = frame_prevl(frame);
-      if (frame + funcproto(frame_func(frame))->framesize > ftop)
-       ftop = frame + funcproto(frame_func(frame))->framesize;
     } else if (frame_iscont(frame)) {
       map[f++] = SNAP_MKFTSZ(frame_ftsz(frame));
       map[f++] = SNAP_MKPC(frame_contpc(frame));
@@ -114,7 +112,10 @@ static BCReg snapshot_framelinks(jit_State *J, SnapEntry *map)
       lua_assert(!frame_isc(frame));
       map[f++] = SNAP_MKFTSZ(frame_ftsz(frame));
       frame = frame_prevd(frame);
+      continue;
     }
+    if (frame + funcproto(frame_func(frame))->framesize > ftop)
+      ftop = frame + funcproto(frame_func(frame))->framesize;
   }
   lua_assert(f == (MSize)(1 + J->framedepth));
   return (BCReg)(ftop - lim);