From 7af27ef59da4051914d93d8b63efac663b64765a Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 28 Dec 2020 11:40:30 -0300 Subject: Cleaner handling of errors in '__close' metamethods Instead of protecting each individual metamethod call, protect the entire call to 'luaF_close'. --- ldo.h | 1 + 1 file changed, 1 insertion(+) (limited to 'ldo.h') diff --git a/ldo.h b/ldo.h index 4d30d072..c7721d62 100644 --- a/ldo.h +++ b/ldo.h @@ -63,6 +63,7 @@ LUAI_FUNC CallInfo *luaD_precall (lua_State *L, StkId func, int nResults); LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults); LUAI_FUNC void luaD_callnoyield (lua_State *L, StkId func, int nResults); LUAI_FUNC void luaD_tryfuncTM (lua_State *L, StkId func); +LUAI_FUNC int luaD_closeprotected (lua_State *L, ptrdiff_t level, int status); LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u, ptrdiff_t oldtop, ptrdiff_t ef); LUAI_FUNC void luaD_poscall (lua_State *L, CallInfo *ci, int nres); -- cgit v1.2.3-55-g6feb