MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / close_func

Function close_func

deps/lua/src/lparser.c:356–380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

354
355
356static void close_func (LexState *ls) {
357 lua_State *L = ls->L;
358 FuncState *fs = ls->fs;
359 Proto *f = fs->f;
360 removevars(ls, 0);
361 luaK_ret(fs, 0, 0); /* final return */
362 luaM_reallocvector(L, f->code, f->sizecode, fs->pc, Instruction);
363 f->sizecode = fs->pc;
364 luaM_reallocvector(L, f->lineinfo, f->sizelineinfo, fs->pc, int);
365 f->sizelineinfo = fs->pc;
366 luaM_reallocvector(L, f->k, f->sizek, fs->nk, TValue);
367 f->sizek = fs->nk;
368 luaM_reallocvector(L, f->p, f->sizep, fs->np, Proto *);
369 f->sizep = fs->np;
370 luaM_reallocvector(L, f->locvars, f->sizelocvars, fs->nlocvars, LocVar);
371 f->sizelocvars = fs->nlocvars;
372 luaM_reallocvector(L, f->upvalues, f->sizeupvalues, f->nups, TString *);
373 f->sizeupvalues = f->nups;
374 lua_assert(luaG_checkcode(f));
375 lua_assert(fs->bl == NULL);
376 ls->fs = fs->prev;
377 /* last token read was anchored in defunct function; must reanchor it */
378 if (fs) anchor_token(ls);
379 L->top -= 2; /* remove table and prototype from the stack */
380}
381
382
383Proto *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