From: Mike Pall Date: Wed, 28 May 2025 19:06:44 +0000 (+0200) Subject: Merge branch 'master' into v2.1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a8cd58ea19850a08d7765f82b79f75553a3d71c;p=thirdparty%2FLuaJIT.git Merge branch 'master' into v2.1 --- 0a8cd58ea19850a08d7765f82b79f75553a3d71c diff --cc src/lj_snap.c index cb104439,54260021..d0d28c81 --- a/src/lj_snap.c +++ b/src/lj_snap.c @@@ -945,19 -865,17 +945,21 @@@ const BCIns *lj_snap_restore(jit_State SnapShot *snap = &T->snap[snapno]; MSize n, nent = snap->nent; SnapEntry *map = &T->snapmap[snap->mapofs]; - SnapEntry *flinks = &T->snapmap[snap_nextofs(T, snap)-1]; - int32_t ftsz0; +#if !LJ_FR2 || defined(LUA_USE_ASSERT) + SnapEntry *flinks = &T->snapmap[snap_nextofs(T, snap)-1-LJ_FR2]; +#endif +#if !LJ_FR2 + ptrdiff_t ftsz0; +#endif TValue *frame; BloomFilter rfilt = snap_renamefilter(T, snapno); - const BCIns *pc = snap_pc(map[nent]); + const BCIns *pc = snap_pc(&map[nent]); lua_State *L = J->L; - /* Set interpreter PC to the next PC to get correct error messages. */ - setcframe_pc(L->cframe, pc+1); + /* Set interpreter PC to the next PC to get correct error messages. + ** But not for returns or tail calls, since pc+1 may be out-of-range. + */ + setcframe_pc(L->cframe, bc_isret_or_tail(bc_op(*pc)) ? pc : pc+1); setcframe_pc(cframe_raw(cframe_prev(L->cframe)), pc); /* Make sure the stack is big enough for the slots from the snapshot. */