MCPcopy Create free account
hub / github.com/F-Stack/f-stack / open_func

Function open_func

freebsd/contrib/openzfs/module/lua/lparser.c:525–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 3

bodyFunction · 0.70
mainfuncFunction · 0.70
vdev_open_children_implFunction · 0.50

Calls 2

luaH_newFunction · 0.70
enterblockFunction · 0.70

Tested by

no test coverage detected