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

Function luaG_findlocal

lib/lua/src/ldebug.c:196–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194
195
196const char *luaG_findlocal (lua_State *L, CallInfo *ci, int n, StkId *pos) {
197 StkId base = ci->func.p + 1;
198 const char *name = NULL;
199 if (isLua(ci)) {
200 if (n < 0) /* access to vararg values? */
201 return findvararg(ci, n, pos);
202 else
203 name = luaF_getlocalname(ci_func(ci)->p, n, currentpc(ci));
204 }
205 if (name == NULL) { /* no 'standard' name? */
206 StkId limit = (ci == L->ci) ? L->top.p : ci->next->func.p;
207 if (limit - base >= n && n > 0) { /* is 'n' inside 'ci' stack? */
208 /* generic name for any valid slot */
209 name = isLua(ci) ? "(temporary)" : "(C temporary)";
210 }
211 else
212 return NULL; /* no name */
213 }
214 if (pos)
215 *pos = base + (n - 1);
216 return name;
217}
218
219
220LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) {

Callers 3

lua_getlocalFunction · 0.85
lua_setlocalFunction · 0.85
checkclosemthFunction · 0.85

Calls 3

findvarargFunction · 0.85
luaF_getlocalnameFunction · 0.85
currentpcFunction · 0.85

Tested by

no test coverage detected