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 /lvm.c | |
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 '')
-rw-r--r-- | lvm.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1662,7 +1662,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { | |||
1662 | if (TESTARG_k(i)) { /* may there be open upvalues? */ | 1662 | if (TESTARG_k(i)) { /* may there be open upvalues? */ |
1663 | if (L->top < ci->top) | 1663 | if (L->top < ci->top) |
1664 | L->top = ci->top; | 1664 | L->top = ci->top; |
1665 | luaF_close(L, base, LUA_OK); | 1665 | luaF_close(L, base, CLOSEKTOP); |
1666 | updatetrap(ci); | 1666 | updatetrap(ci); |
1667 | updatestack(ci); | 1667 | updatestack(ci); |
1668 | } | 1668 | } |