From b07fc10e91a5954254b47280aba287220c734a4b Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 13 Jan 2021 13:54:10 -0300 Subject: 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. --- lstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lstate.c') diff --git a/lstate.c b/lstate.c index a6ef82a3..92ccbf9b 100644 --- a/lstate.c +++ b/lstate.c @@ -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); -- cgit v1.2.3-55-g6feb