diff options
Diffstat (limited to '')
-rw-r--r-- | lapi.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -195,7 +195,7 @@ LUA_API void lua_settop (lua_State *L, int idx) { | |||
195 | } | 195 | } |
196 | newtop = L->top.p + diff; | 196 | newtop = L->top.p + diff; |
197 | if (diff < 0 && L->tbclist.p >= newtop) { | 197 | if (diff < 0 && L->tbclist.p >= newtop) { |
198 | lua_assert(ci->callstatus & CIST_CLSRET); | 198 | lua_assert(ci->callstatus & CIST_TBC); |
199 | newtop = luaF_close(L, newtop, CLOSEKTOP, 0); | 199 | newtop = luaF_close(L, newtop, CLOSEKTOP, 0); |
200 | } | 200 | } |
201 | L->top.p = newtop; /* correct top only after closing any upvalue */ | 201 | L->top.p = newtop; /* correct top only after closing any upvalue */ |
@@ -207,7 +207,7 @@ LUA_API void lua_closeslot (lua_State *L, int idx) { | |||
207 | StkId level; | 207 | StkId level; |
208 | lua_lock(L); | 208 | lua_lock(L); |
209 | level = index2stack(L, idx); | 209 | level = index2stack(L, idx); |
210 | api_check(L, (L->ci->callstatus & CIST_CLSRET) && L->tbclist.p == level, | 210 | api_check(L, (L->ci->callstatus & CIST_TBC) && (L->tbclist.p == level), |
211 | "no variable to close at given level"); | 211 | "no variable to close at given level"); |
212 | level = luaF_close(L, level, CLOSEKTOP, 0); | 212 | level = luaF_close(L, level, CLOSEKTOP, 0); |
213 | setnilvalue(s2v(level)); | 213 | setnilvalue(s2v(level)); |
@@ -1280,7 +1280,7 @@ LUA_API void lua_toclose (lua_State *L, int idx) { | |||
1280 | o = index2stack(L, idx); | 1280 | o = index2stack(L, idx); |
1281 | api_check(L, L->tbclist.p < o, "given index below or equal a marked one"); | 1281 | api_check(L, L->tbclist.p < o, "given index below or equal a marked one"); |
1282 | luaF_newtbcupval(L, o); /* create new to-be-closed upvalue */ | 1282 | luaF_newtbcupval(L, o); /* create new to-be-closed upvalue */ |
1283 | L->ci->callstatus |= CIST_CLSRET; /* mark that function has TBC slots */ | 1283 | L->ci->callstatus |= CIST_TBC; /* mark that function has TBC slots */ |
1284 | lua_unlock(L); | 1284 | lua_unlock(L); |
1285 | } | 1285 | } |
1286 | 1286 | ||