MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / luaF_getlocalname

Function luaF_getlocalname

lib/lua/src/lfunc.c:283–293  ·  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

281** Returns NULL if not found.
282*/
283const char *luaF_getlocalname (const Proto *f, int local_number, int pc) {
284 int i;
285 for (i = 0; i<f->sizelocvars && f->locvars[i].startpc <= pc; i++) {
286 if (pc < f->locvars[i].endpc) { /* is variable active? */
287 local_number--;
288 if (local_number == 0)
289 return getstr(f->locvars[i].varname);
290 }
291 }
292 return NULL; /* not found */
293}
294

Callers 3

luaG_findlocalFunction · 0.85
lua_getlocalFunction · 0.85
basicgetobjnameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected