Fix handling of errors during snapshot restore.

This commit is contained in:
Mike Pall 2020-08-09 18:08:38 +02:00
parent 2211f6f960
commit 12ab596997

View File

@ -701,6 +701,8 @@ static TValue *trace_exit_cp(lua_State *L, lua_CFunction dummy, void *ud)
{
ExitDataCP *exd = (ExitDataCP *)ud;
cframe_errfunc(L->cframe) = -1; /* Inherit error function. */
/* Always catch error here. */
cframe_nres(L->cframe) = -2*LUAI_MAXSTACK*(int)sizeof(TValue);
exd->pc = lj_snap_restore(exd->J, exd->exptr);
UNUSED(dummy);
return NULL;