MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / luaE_resetthread

Function luaE_resetthread

xrepo/packages/l/lua/port/lua/src/lstate.c:327–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

lua_resetthreadFunction · 0.85
luaD_throwFunction · 0.85

Calls 3

luaD_closeprotectedFunction · 0.85
luaD_seterrorobjFunction · 0.85
luaD_reallocstackFunction · 0.70

Tested by

no test coverage detected