aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2014-04-03 21:45:57 +0200
committerMike Pall <mike>2014-04-03 21:45:57 +0200
commit111b2e8711366b40161b4530f5f0a4fd08dc3420 (patch)
tree231a0c1beb979ffc8eb798a1a44b9f8c407c8a12 /src
parentb293063eb823160d3f87c1d56f98a742ee8ee58e (diff)
downloadluajit-111b2e8711366b40161b4530f5f0a4fd08dc3420.tar.gz
luajit-111b2e8711366b40161b4530f5f0a4fd08dc3420.tar.bz2
luajit-111b2e8711366b40161b4530f5f0a4fd08dc3420.zip
Fix top slot calculation for snapshots with continuations.
Diffstat (limited to 'src')
-rw-r--r--src/lj_snap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lj_snap.c b/src/lj_snap.c
index 1c978c26..803533cd 100644
--- a/src/lj_snap.c
+++ b/src/lj_snap.c
@@ -104,8 +104,6 @@ static BCReg snapshot_framelinks(jit_State *J, SnapEntry *map)
104 if (frame_islua(frame)) { 104 if (frame_islua(frame)) {
105 map[f++] = SNAP_MKPC(frame_pc(frame)); 105 map[f++] = SNAP_MKPC(frame_pc(frame));
106 frame = frame_prevl(frame); 106 frame = frame_prevl(frame);
107 if (frame + funcproto(frame_func(frame))->framesize > ftop)
108 ftop = frame + funcproto(frame_func(frame))->framesize;
109 } else if (frame_iscont(frame)) { 107 } else if (frame_iscont(frame)) {
110 map[f++] = SNAP_MKFTSZ(frame_ftsz(frame)); 108 map[f++] = SNAP_MKFTSZ(frame_ftsz(frame));
111 map[f++] = SNAP_MKPC(frame_contpc(frame)); 109 map[f++] = SNAP_MKPC(frame_contpc(frame));
@@ -114,7 +112,10 @@ static BCReg snapshot_framelinks(jit_State *J, SnapEntry *map)
114 lua_assert(!frame_isc(frame)); 112 lua_assert(!frame_isc(frame));
115 map[f++] = SNAP_MKFTSZ(frame_ftsz(frame)); 113 map[f++] = SNAP_MKFTSZ(frame_ftsz(frame));
116 frame = frame_prevd(frame); 114 frame = frame_prevd(frame);
115 continue;
117 } 116 }
117 if (frame + funcproto(frame_func(frame))->framesize > ftop)
118 ftop = frame + funcproto(frame_func(frame))->framesize;
118 } 119 }
119 lua_assert(f == (MSize)(1 + J->framedepth)); 120 lua_assert(f == (MSize)(1 + J->framedepth));
120 return (BCReg)(ftop - lim); 121 return (BCReg)(ftop - lim);