aboutsummaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
Diffstat (limited to 'lvm.c')
-rw-r--r--lvm.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lvm.c b/lvm.c
index a6dcc9ff..50d967c6 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1427,7 +1427,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
1427 } 1427 }
1428 vmcase(OP_CLOSE) { 1428 vmcase(OP_CLOSE) {
1429 L->top = ra + 1; /* everything is free after this slot */ 1429 L->top = ra + 1; /* everything is free after this slot */
1430 ProtectNT(luaF_close(L, ra, LUA_OK)); 1430 Protect(luaF_close(L, ra, LUA_OK));
1431 vmbreak; 1431 vmbreak;
1432 } 1432 }
1433 vmcase(OP_TBC) { 1433 vmcase(OP_TBC) {
@@ -1717,9 +1717,8 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
1717 vmbreak; 1717 vmbreak;
1718 } 1718 }
1719 vmcase(OP_TFORPREP) { 1719 vmcase(OP_TFORPREP) {
1720 /* is 'toclose' a function or has a '__close' metamethod? */ 1720 /* is 'toclose' not nil? */
1721 if (ttisfunction(s2v(ra + 3)) || 1721 if (!ttisnil(s2v(ra + 3))) {
1722 !ttisnil(luaT_gettmbyobj(L, s2v(ra + 3), TM_CLOSE))) {
1723 /* create to-be-closed upvalue for it */ 1722 /* create to-be-closed upvalue for it */
1724 halfProtect(luaF_newtbcupval(L, ra + 3)); 1723 halfProtect(luaF_newtbcupval(L, ra + 3));
1725 } 1724 }