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

Function adjust_varargs

third-party/lua-5.2.4/src/ldo.c:257–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255
256
257static StkId adjust_varargs (lua_State *L, Proto *p, int actual) {
258 int i;
259 int nfixargs = p->numparams;
260 StkId base, fixed;
261 lua_assert(actual >= nfixargs);
262 /* move fixed parameters to final position */
263 luaD_checkstack(L, p->maxstacksize); /* check again for new 'base' */
264 fixed = L->top - actual; /* first fixed argument */
265 base = L->top; /* final position of first argument */
266 for (i=0; i<nfixargs; i++) {
267 setobjs2s(L, L->top++, fixed + i);
268 setnilvalue(fixed + i);
269 }
270 return base;
271}
272
273
274static StkId tryfuncTM (lua_State *L, StkId func) {

Callers 1

luaD_precallFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected