MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / luaF_getlocalname

Function luaF_getlocalname

deps/lua/src/lfunc.c:163–173  ·  view source on GitHub ↗

** Look for n-th local variable at line `line' in function `func'. ** Returns NULL if not found. */

Source from the content-addressed store, hash-verified

161** Returns NULL if not found.
162*/
163const char *luaF_getlocalname (const Proto *f, int local_number, int pc) {
164 int i;
165 for (i = 0; i<f->sizelocvars && f->locvars[i].startpc <= pc; i++) {
166 if (pc < f->locvars[i].endpc) { /* is variable active? */
167 local_number--;
168 if (local_number == 0)
169 return getstr(f->locvars[i].varname);
170 }
171 }
172 return NULL; /* not found */
173}
174

Callers 2

findlocalFunction · 0.85
getobjnameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected