Bug: stack overflow with nesting of coroutine.close

This commit is contained in:
Roberto Ierusalimschy
2022-10-25 16:44:06 -03:00
parent b85816b9a8
commit 1e64c1391f
6 changed files with 38 additions and 6 deletions

View File

@@ -343,9 +343,10 @@ int luaE_resetthread (lua_State *L, int status) {
}
LUA_API int lua_resetthread (lua_State *L) {
LUA_API int lua_resetthread (lua_State *L, lua_State *from) {
int status;
lua_lock(L);
L->nCcalls = (from) ? getCcalls(from) : 0;
status = luaE_resetthread(L, L->status);
lua_unlock(L);
return status;