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

Function luaF_getlocalname

third-party/lua-5.2.4/src/lfunc.c:150–160  ·  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

148** Returns NULL if not found.
149*/
150const char *luaF_getlocalname (const Proto *f, int local_number, int pc) {
151 int i;
152 for (i = 0; i<f->sizelocvars && f->locvars[i].startpc <= pc; i++) {
153 if (pc < f->locvars[i].endpc) { /* is variable active? */
154 local_number--;
155 if (local_number == 0)
156 return getstr(f->locvars[i].varname);
157 }
158 }
159 return NULL; /* not found */
160}
161

Callers 3

findlocalFunction · 0.70
lua_getlocalFunction · 0.70
getobjnameFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected