MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaE_resetthread

Function luaE_resetthread

third-party/lua-5.4.6/src/lstate.c:325–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

323
324
325int luaE_resetthread (lua_State *L, int status) {
326 CallInfo *ci = L->ci = &L->base_ci; /* unwind CallInfo list */
327 setnilvalue(s2v(L->stack.p)); /* 'function' entry for basic 'ci' */
328 ci->func.p = L->stack.p;
329 ci->callstatus = CIST_C;
330 if (status == LUA_YIELD)
331 status = LUA_OK;
332 L->status = LUA_OK; /* so it can run __close metamethods */
333 L->errfunc = 0; /* stack unwind can "throw away" the error function */
334 status = luaD_closeprotected(L, 1, status);
335 if (status != LUA_OK) /* errors? */
336 luaD_seterrorobj(L, status, L->stack.p + 1);
337 else
338 L->top.p = L->stack.p + 1;
339 ci->top.p = L->top.p + LUA_MINSTACK;
340 luaD_reallocstack(L, cast_int(ci->top.p - L->stack.p), 0);
341 return status;
342}
343
344
345LUA_API int lua_closethread (lua_State *L, lua_State *from) {

Callers 2

lua_closethreadFunction · 0.70
luaD_throwFunction · 0.70

Calls 3

luaD_closeprotectedFunction · 0.70
luaD_seterrorobjFunction · 0.70
luaD_reallocstackFunction · 0.70

Tested by

no test coverage detected