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

Function luaF_getlocalname

third-party/lua-5.5.0/src/lfunc.c:303–313  ·  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

301** Returns NULL if not found.
302*/
303const char *luaF_getlocalname (const Proto *f, int local_number, int pc) {
304 int i;
305 for (i = 0; i<f->sizelocvars && f->locvars[i].startpc <= pc; i++) {
306 if (pc < f->locvars[i].endpc) { /* is variable active? */
307 local_number--;
308 if (local_number == 0)
309 return getstr(f->locvars[i].varname);
310 }
311 }
312 return NULL; /* not found */
313}
314

Callers 3

luaG_findlocalFunction · 0.70
lua_getlocalFunction · 0.70
basicgetobjnameFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected