MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / correctstack

Function correctstack

extlibs/lua/src/ldo.c:164–178  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers 1

luaD_reallocstackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected