MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / pushclosure

Function pushclosure

lua/lparser.c:341–356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339
340
341static void pushclosure (LexState *ls, FuncState *func, expdesc *v) {
342 FuncState *fs = ls->fs;
343 Proto *f = fs->f;
344 int oldsize = f->sizep;
345 int i;
346 luaM_growvector(ls->L, f->p, fs->np, f->sizep, Proto *,
347 MAXARG_Bx, "constant table overflow");
348 while (oldsize < f->sizep) f->p[oldsize++] = NULL;
349 f->p[fs->np++] = func->f;
350 luaC_objbarrier(ls->L, f, func->f);
351 init_exp(v, VRELOCABLE, luaK_codeABx(fs, OP_CLOSURE, 0, fs->np-1));
352 for (i=0; i<func->f->nups; i++) {
353 OpCode o = (func->upvalues[i].k == VLOCAL) ? OP_MOVE : OP_GETUPVAL;
354 luaK_codeABC(fs, o, 0, func->upvalues[i].info, 0);
355 }
356}
357
358
359static 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