MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / pushclosure

Function pushclosure

Source/Misc/lua/src/lua.c:7886–7901  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7884
7885
7886static void pushclosure (LexState *ls, FuncState *func, expdesc *v) {
7887FuncState *fs = ls->fs;
7888Proto *f = fs->f;
7889int oldsize = f->sizep;
7890int i;
7891luaM_growvector(ls->L, f->p, fs->np, f->sizep, Proto *,
7892MAXARG_Bx, "constant table overflow");
7893while (oldsize < f->sizep) f->p[oldsize++] = NULL;
7894f->p[fs->np++] = func->f;
7895luaC_objbarrier(ls->L, f, func->f);
7896init_exp(v, VRELOCABLE, luaK_codeABx(fs, OP_CLOSURE, 0, fs->np-1));
7897for (i=0; i<func->f->nups; i++) {
7898OpCode o = (func->upvalues[i].k == VLOCAL) ? OP_MOVE : OP_GETUPVAL;
7899luaK_codeABC(fs, o, 0, func->upvalues[i].info, 0);
7900}
7901}
7902
7903
7904static void open_func (LexState *ls, FuncState *fs) {

Callers 1

bodyFunction · 0.85

Calls 3

init_expFunction · 0.85
luaK_codeABxFunction · 0.85
luaK_codeABCFunction · 0.85

Tested by

no test coverage detected