MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / correctstack

Function correctstack

3rd/lua-5.4.3/src/ldo.c:160–173  ·  view source on GitHub ↗

** {================================================================== ** Stack reallocation ** =================================================================== */

Source from the content-addressed store, hash-verified

158** ===================================================================
159*/
160static void correctstack (lua_State *L, StkId oldstack, StkId newstack) {
161 CallInfo *ci;
162 UpVal *up;
163 L->top = (L->top - oldstack) + newstack;
164 L->tbclist = (L->tbclist - oldstack) + newstack;
165 for (up = L->openupval; up != NULL; up = up->u.open.next)
166 up->v = s2v((uplevel(up) - oldstack) + newstack);
167 for (ci = L->ci; ci != NULL; ci = ci->previous) {
168 ci->top = (ci->top - oldstack) + newstack;
169 ci->func = (ci->func - oldstack) + newstack;
170 if (isLua(ci))
171 ci->u.l.trap = 1; /* signal to update 'trap' in 'luaV_execute' */
172 }
173}
174
175
176/* some space for error handling */

Callers 1

luaD_reallocstackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected