MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / registerlocalvar

Function registerlocalvar

3rd/lua-5.4.3/src/lparser.c:175–186  ·  view source on GitHub ↗

** Register a new local variable in the active 'Proto' (for debug ** information). */

Source from the content-addressed store, hash-verified

173** information).
174*/
175static int registerlocalvar (LexState *ls, FuncState *fs, TString *varname) {
176 Proto *f = fs->f;
177 int oldsize = f->sizelocvars;
178 luaM_growvector(ls->L, f->locvars, fs->ndebugvars, f->sizelocvars,
179 LocVar, SHRT_MAX, "local variables");
180 while (oldsize < f->sizelocvars)
181 f->locvars[oldsize++].varname = NULL;
182 f->locvars[fs->ndebugvars].varname = varname;
183 f->locvars[fs->ndebugvars].startpc = fs->pc;
184 luaC_objbarrier(ls->L, f, varname);
185 return fs->ndebugvars++;
186}
187
188
189/*

Callers 1

adjustlocalvarsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected