aboutsummaryrefslogtreecommitdiff
path: root/lfunc.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-12-28 11:40:30 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-12-28 11:40:30 -0300
commit7af27ef59da4051914d93d8b63efac663b64765a (patch)
tree73ac919879b442904112dbb972412fc15983d50e /lfunc.h
parent0ceada8da92135717d31a3954b5b89a954f9e71a (diff)
downloadlua-7af27ef59da4051914d93d8b63efac663b64765a.tar.gz
lua-7af27ef59da4051914d93d8b63efac663b64765a.tar.bz2
lua-7af27ef59da4051914d93d8b63efac663b64765a.zip
Cleaner handling of errors in '__close' metamethods
Instead of protecting each individual metamethod call, protect the entire call to 'luaF_close'.
Diffstat (limited to 'lfunc.h')
-rw-r--r--lfunc.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/lfunc.h b/lfunc.h
index 8d6f965c..40de4636 100644
--- a/lfunc.h
+++ b/lfunc.h
@@ -49,8 +49,8 @@
49/* close upvalues without running their closing methods */ 49/* close upvalues without running their closing methods */
50#define NOCLOSINGMETH (-1) 50#define NOCLOSINGMETH (-1)
51 51
52/* close upvalues running all closing methods in protected mode */ 52/* special status to close upvalues preserving the top of the stack */
53#define CLOSEPROTECT (-2) 53#define CLOSEKTOP (-2)
54 54
55 55
56LUAI_FUNC Proto *luaF_newproto (lua_State *L); 56LUAI_FUNC Proto *luaF_newproto (lua_State *L);
@@ -59,7 +59,7 @@ LUAI_FUNC LClosure *luaF_newLclosure (lua_State *L, int nupvals);
59LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl); 59LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl);
60LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); 60LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level);
61LUAI_FUNC void luaF_newtbcupval (lua_State *L, StkId level); 61LUAI_FUNC void luaF_newtbcupval (lua_State *L, StkId level);
62LUAI_FUNC int luaF_close (lua_State *L, StkId level, int status); 62LUAI_FUNC void luaF_close (lua_State *L, StkId level, int status);
63LUAI_FUNC void luaF_unlinkupval (UpVal *uv); 63LUAI_FUNC void luaF_unlinkupval (UpVal *uv);
64LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); 64LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f);
65LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number, 65LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number,