Allow yields inside '__close' metamethods

Initial implementation to allow yields inside '__close' metamethods.
This current version still does not allow a '__close' metamethod
to yield when called due to an error. '__close' metamethods from
C functions also are not allowed to yield.
This commit is contained in:
Roberto Ierusalimschy
2021-01-13 13:54:10 -03:00
parent cc1692515e
commit b07fc10e91
7 changed files with 114 additions and 18 deletions

View File

@@ -313,7 +313,7 @@ LUA_API lua_State *lua_newthread (lua_State *L) {
void luaE_freethread (lua_State *L, lua_State *L1) {
LX *l = fromstate(L1);
luaF_close(L1, L1->stack, NOCLOSINGMETH); /* close all upvalues */
luaF_close(L1, L1->stack, NOCLOSINGMETH, 0); /* close all upvalues */
lua_assert(L1->openupval == NULL);
luai_userstatefree(L, L1);
freestack(L1);