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

Function open_func

third-party/lua-5.5.0/src/lparser.c:799–827  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

797
798
799static void open_func (LexState *ls, FuncState *fs, BlockCnt *bl) {
800 lua_State *L = ls->L;
801 Proto *f = fs->f;
802 fs->prev = ls->fs; /* linked list of funcstates */
803 fs->ls = ls;
804 ls->fs = fs;
805 fs->pc = 0;
806 fs->previousline = f->linedefined;
807 fs->iwthabs = 0;
808 fs->lasttarget = 0;
809 fs->freereg = 0;
810 fs->nk = 0;
811 fs->nabslineinfo = 0;
812 fs->np = 0;
813 fs->nups = 0;
814 fs->ndebugvars = 0;
815 fs->nactvar = 0;
816 fs->needclose = 0;
817 fs->firstlocal = ls->dyd->actvar.n;
818 fs->firstlabel = ls->dyd->label.n;
819 fs->bl = NULL;
820 f->source = ls->source;
821 luaC_objbarrier(L, f, f->source);
822 f->maxstacksize = 2; /* registers 0/1 are always valid */
823 fs->kcache = luaH_new(L); /* create table for function */
824 sethvalue2s(L, L->top.p, fs->kcache); /* anchor it */
825 luaD_inctop(L);
826 enterblock(fs, bl, 0);
827}
828
829
830static void close_func (LexState *ls) {

Callers 2

bodyFunction · 0.70
mainfuncFunction · 0.70

Calls 3

luaH_newFunction · 0.70
luaD_inctopFunction · 0.70
enterblockFunction · 0.70

Tested by

no test coverage detected