Prevent snapshot purge while recording a function header.

Thanks to Sergey Kaplun. #1425
This commit is contained in:
Mike Pall
2026-02-11 23:04:42 +01:00
parent 707c12bf00
commit d459c6ce50

View File

@@ -2276,7 +2276,7 @@ void lj_record_ins(jit_State *J)
/* Need snapshot before recording next bytecode (e.g. after a store). */
if (J->needsnap) {
J->needsnap = 0;
if (J->pt) lj_snap_purge(J);
if (J->pt && bc_op(*J->pc) < BC_FUNCF) lj_snap_purge(J);
lj_snap_add(J);
J->mergesnap = 1;
}