Skip to content

Commit

Permalink
fixes bug
Browse files Browse the repository at this point in the history
  • Loading branch information
actboy168 committed Apr 2, 2024
1 parent 1b0f854 commit a645737
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
6 changes: 0 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
{
"[c]": {
"editor.formatOnSave": true,
},
"[cpp]": {
"editor.formatOnSave": true,
},
"C_Cpp.autoAddFileAssociations": false,
}
4 changes: 0 additions & 4 deletions 3rd/lua/lua54/lcorolib.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ static int luaB_auxwrap (lua_State *L) {
if (l_unlikely(r < 0)) { /* error? */
int stat = lua_status(co);
if (stat != LUA_OK && stat != LUA_YIELD) { /* error in the coroutine? */
luai_threadcall(co, L);
stat = lua_closethread(co, L); /* close its tbc variables */
luai_threadret(L, co);
lua_assert(stat != LUA_OK);
lua_xmove(co, L, 1); /* move error message to the caller */
}
Expand Down Expand Up @@ -176,9 +174,7 @@ static int luaB_close (lua_State *L) {
int status = auxstatus(L, co);
switch (status) {
case COS_DEAD: case COS_YIELD: {
luai_threadcall(co, L);
status = lua_closethread(co, L);
luai_threadret(L, co);
if (status == LUA_OK) {
lua_pushboolean(L, 1);
return 1;
Expand Down
2 changes: 2 additions & 0 deletions 3rd/lua/lua54/lstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,10 @@ int luaE_resetthread (lua_State *L, int status) {
LUA_API int lua_closethread (lua_State *L, lua_State *from) {
int status;
lua_lock(L);
luai_threadcall(L, from);
L->nCcalls = (from) ? getCcalls(from) : 0;
status = luaE_resetthread(L, L->status);
luai_threadret(from, L);
lua_unlock(L);
return status;
}
Expand Down

0 comments on commit a645737

Please sign in to comment.