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

Function stacklevel

extlibs/lua/src/lparser.c:227–236  ·  view source on GitHub ↗

** Convert 'nvar' (number of active variables at some point) to ** number of variables in the stack at that point. */

Source from the content-addressed store, hash-verified

225** number of variables in the stack at that point.
226*/
227static int stacklevel (FuncState *fs, int nvar) {
228 while (nvar > 0) {
229 Vardesc *vd = getlocalvardesc(fs, nvar - 1);
230 if (vd->vd.kind != RDKCTC) /* is in the stack? */
231 return vd->vd.sidx + 1;
232 else
233 nvar--; /* try previous variable */
234 }
235 return 0; /* no variables */
236}
237
238
239/*

Callers 6

luaY_nvarstackFunction · 0.85
movegotosoutFunction · 0.85
leaveblockFunction · 0.85
gotostatFunction · 0.85
repeatstatFunction · 0.85
issinglejumpFunction · 0.85

Calls 1

getlocalvardescFunction · 0.85

Tested by

no test coverage detected