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

Function buildhiddenargs

third-party/lua-5.5.0/src/ltm.c:255–269  ·  view source on GitHub ↗

** initial stack: func arg1 ... argn extra1 ... ** ^ ci->func ^ L->top ** final stack: func nil ... nil extra1 ... func arg1 ... argn ** ^ ci->func */

Source from the content-addressed store, hash-verified

253** ^ ci->func
254*/
255static void buildhiddenargs (lua_State *L, CallInfo *ci, const Proto *p,
256 int totalargs, int nfixparams, int nextra) {
257 int i;
258 ci->u.l.nextraargs = nextra;
259 luaD_checkstack(L, p->maxstacksize + 1);
260 /* copy function to the top of the stack, after extra arguments */
261 setobjs2s(L, L->top.p++, ci->func.p);
262 /* move fixed parameters to after the copied function */
263 for (i = 1; i <= nfixparams; i++) {
264 setobjs2s(L, L->top.p++, ci->func.p + i);
265 setnilvalue(s2v(ci->func.p + i)); /* erase original parameter (for GC) */
266 }
267 ci->func.p += totalargs + 1; /* 'func' now lives after hidden arguments */
268 ci->top.p += totalargs + 1;
269}
270
271
272void luaT_adjustvarargs (lua_State *L, CallInfo *ci, const Proto *p) {

Callers 1

luaT_adjustvarargsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected