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

Function open_func

third-party/lua-5.2.4/src/lparser.c:527–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

525
526
527static void open_func (LexState *ls, FuncState *fs, BlockCnt *bl) {
528 lua_State *L = ls->L;
529 Proto *f;
530 fs->prev = ls->fs; /* linked list of funcstates */
531 fs->ls = ls;
532 ls->fs = fs;
533 fs->pc = 0;
534 fs->lasttarget = 0;
535 fs->jpc = NO_JUMP;
536 fs->freereg = 0;
537 fs->nk = 0;
538 fs->np = 0;
539 fs->nups = 0;
540 fs->nlocvars = 0;
541 fs->nactvar = 0;
542 fs->firstlocal = ls->dyd->actvar.n;
543 fs->bl = NULL;
544 f = fs->f;
545 f->source = ls->source;
546 f->maxstacksize = 2; /* registers 0/1 are always valid */
547 fs->h = luaH_new(L);
548 /* anchor table of constants (to avoid being collected) */
549 sethvalue2s(L, L->top, fs->h);
550 incr_top(L);
551 enterblock(fs, bl, 0);
552}
553
554
555static void close_func (LexState *ls) {

Callers 2

bodyFunction · 0.70
mainfuncFunction · 0.70

Calls 2

luaH_newFunction · 0.70
enterblockFunction · 0.70

Tested by

no test coverage detected