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

Function close_func

lua/lparser.c:387–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

385
386
387static void close_func (LexState *ls) {
388 lua_State *L = ls->L;
389 FuncState *fs = ls->fs;
390 Proto *f = fs->f;
391 removevars(ls, 0);
392 luaK_ret(fs, 0, 0); /* final return */
393 luaM_reallocvector(L, f->code, f->sizecode, fs->pc, Instruction);
394 f->sizecode = fs->pc;
395 luaM_reallocvector(L, f->lineinfo, f->sizelineinfo, fs->pc, int);
396 f->sizelineinfo = fs->pc;
397 luaM_reallocvector(L, f->k, f->sizek, fs->nk, TValue);
398 f->sizek = fs->nk;
399 luaM_reallocvector(L, f->p, f->sizep, fs->np, Proto *);
400 f->sizep = fs->np;
401 luaM_reallocvector(L, f->locvars, f->sizelocvars, fs->nlocvars, LocVar);
402 f->sizelocvars = fs->nlocvars;
403 luaM_reallocvector(L, f->upvalues, f->sizeupvalues, f->nups, TString *);
404 f->sizeupvalues = f->nups;
405 lua_assert(luaG_checkcode(f));
406 lua_assert(fs->bl == NULL);
407 ls->fs = fs->prev;
408 L->top -= 2; /* remove table and prototype from the stack */
409 /* last token read was anchored in defunct function; must reanchor it */
410 if (fs) anchor_token(ls);
411}
412
413
414Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name) {

Callers 2

luaY_parserFunction · 0.85
bodyFunction · 0.85

Calls 4

removevarsFunction · 0.85
luaK_retFunction · 0.85
luaG_checkcodeFunction · 0.85
anchor_tokenFunction · 0.85

Tested by

no test coverage detected