diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-12-28 11:40:30 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-12-28 11:40:30 -0300 |
| commit | 7af27ef59da4051914d93d8b63efac663b64765a (patch) | |
| tree | 73ac919879b442904112dbb972412fc15983d50e /lfunc.h | |
| parent | 0ceada8da92135717d31a3954b5b89a954f9e71a (diff) | |
| download | lua-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.h | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -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 | ||
| 56 | LUAI_FUNC Proto *luaF_newproto (lua_State *L); | 56 | LUAI_FUNC Proto *luaF_newproto (lua_State *L); |
| @@ -59,7 +59,7 @@ LUAI_FUNC LClosure *luaF_newLclosure (lua_State *L, int nupvals); | |||
| 59 | LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl); | 59 | LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl); |
| 60 | LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); | 60 | LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); |
| 61 | LUAI_FUNC void luaF_newtbcupval (lua_State *L, StkId level); | 61 | LUAI_FUNC void luaF_newtbcupval (lua_State *L, StkId level); |
| 62 | LUAI_FUNC int luaF_close (lua_State *L, StkId level, int status); | 62 | LUAI_FUNC void luaF_close (lua_State *L, StkId level, int status); |
| 63 | LUAI_FUNC void luaF_unlinkupval (UpVal *uv); | 63 | LUAI_FUNC void luaF_unlinkupval (UpVal *uv); |
| 64 | LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); | 64 | LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); |
| 65 | LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number, | 65 | LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number, |
