Skip to content

Commit

Permalink
lua: update lua version to v5.4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
zebin-wu committed Dec 23, 2023
1 parent d5f22f8 commit 02318e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions bridge/src/lc.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,14 @@ lua_State *lc_newthread(lua_State *L) {
return co;
}

static void lc_freethread(lua_State *L) {
static void lc_freethread(lua_State *L, lua_State *from) {
if (thread_pool_full()) {
lua_pushnil(L);
lua_rawsetp(L, LUA_REGISTRYINDEX, L);
} else {
thread_pool_enque(L);
}
lua_resetthread(L);
lua_closethread(L, from);
}

int lc_resume(lua_State *L, lua_State *from, int narg, int *nres) {
Expand All @@ -216,13 +216,13 @@ int lc_resume(lua_State *L, lua_State *from, int narg, int *nres) {
luaL_error(L, "too many arguments to resume");
}
lua_xmove(L, from, *nres);
lc_freethread(L);
lc_freethread(L, from);
break;
case LUA_YIELD:
break;
default:
luaL_traceback(from, L, lua_tostring(L, -1), 1);
lc_freethread(L);
lc_freethread(L, from);
break;
}
return status;
Expand Down
2 changes: 1 addition & 1 deletion third_party/lua/lua

0 comments on commit 02318e2

Please sign in to comment.