MCPcopy Create free account
hub / github.com/DFHack/dfhack / addprototype

Function addprototype

depends/lua/src/lparser.c:499–513  ·  view source on GitHub ↗

** adds a new prototype into list of prototypes */

Source from the content-addressed store, hash-verified

497** adds a new prototype into list of prototypes
498*/
499static Proto *addprototype (LexState *ls) {
500 Proto *clp;
501 lua_State *L = ls->L;
502 FuncState *fs = ls->fs;
503 Proto *f = fs->f; /* prototype of current function */
504 if (fs->np >= f->sizep) {
505 int oldsize = f->sizep;
506 luaM_growvector(L, f->p, fs->np, f->sizep, Proto *, MAXARG_Bx, "functions");
507 while (oldsize < f->sizep)
508 f->p[oldsize++] = NULL;
509 }
510 f->p[fs->np++] = clp = luaF_newproto(L);
511 luaC_objbarrier(L, f, clp);
512 return clp;
513}
514
515
516/*

Callers 1

bodyFunction · 0.85

Calls 1

luaF_newprotoFunction · 0.85

Tested by

no test coverage detected