MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / LoadFunction

Function LoadFunction

Source/Misc/lua/src/lua.c:10064–10084  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10062}
10063
10064static Proto* LoadFunction(LoadState* S, TString* p)
10065{
10066Proto* f;
10067if (++S->L->nCcalls > LUAI_MAXCCALLS) error(S,"code too deep");
10068f=luaF_newproto(S->L);
10069setptvalue2s(S->L,S->L->top,f); incr_top(S->L);
10070f->source=LoadString(S); if (f->source==NULL) f->source=p;
10071f->linedefined=LoadInt(S);
10072f->lastlinedefined=LoadInt(S);
10073f->nups=LoadByte(S);
10074f->numparams=LoadByte(S);
10075f->is_vararg=LoadByte(S);
10076f->maxstacksize=LoadByte(S);
10077LoadCode(S,f);
10078LoadConstants(S,f);
10079LoadDebug(S,f);
10080IF (!luaG_checkcode(f), "bad code");
10081S->L->top--;
10082S->L->nCcalls--;
10083return f;
10084}
10085
10086static void LoadHeader(LoadState* S)
10087{

Callers 2

LoadConstantsFunction · 0.85
luaU_undumpFunction · 0.85

Calls 8

luaF_newprotoFunction · 0.85
LoadStringFunction · 0.85
LoadIntFunction · 0.85
LoadCodeFunction · 0.85
LoadConstantsFunction · 0.85
LoadDebugFunction · 0.85
luaG_checkcodeFunction · 0.85
errorFunction · 0.70

Tested by

no test coverage detected