Avoid out-of-range PC for stack overflow error from snapshot restore.

Reported by Sergey Kaplun. #1359
This commit is contained in:
Mike Pall
2025-05-28 21:02:31 +02:00
parent 9c8eb7cfe1
commit cd4af8ad80
3 changed files with 10 additions and 15 deletions

View File

@@ -255,6 +255,11 @@ static LJ_AINLINE int bc_isret(BCOp op)
return (op == BC_RETM || op == BC_RET || op == BC_RET0 || op == BC_RET1);
}
static LJ_AINLINE int bc_isret_or_tail(BCOp op)
{
return (op == BC_CALLMT || op == BC_CALLT || bc_isret(op));
}
LJ_DATA const uint16_t lj_bc_mode[];
LJ_DATA const uint16_t lj_bc_ofs[];