Fix snapshot PC when linking to BC_JLOOP that was a BC_RET*.

Reported by Arseny Vakhrushev.
Fix contributed by Peter Cawley.
This commit is contained in:
Mike Pall
2020-10-12 15:45:05 +02:00
parent de6b1a11dd
commit 5c46f47736
2 changed files with 8 additions and 4 deletions

View File

@@ -97,6 +97,9 @@ static BCReg snapshot_framelinks(jit_State *J, SnapEntry *map)
cTValue *ftop = frame + funcproto(frame_func(frame))->framesize;
MSize f = 0;
map[f++] = SNAP_MKPC(J->pc); /* The current PC is always the first entry. */
lua_assert(!J->pt ||
(J->pc >= proto_bc(J->pt) &&
J->pc < proto_bc(J->pt) + J->pt->sizebc));
while (frame > lim) { /* Backwards traversal of all frames above base. */
if (frame_islua(frame)) {
map[f++] = SNAP_MKPC(frame_pc(frame));