MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / findlocal

Function findlocal

Source/Misc/lua/src/lua.c:4620–4632  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4618
4619
4620static const char *findlocal (lua_State *L, CallInfo *ci, int n) {
4621const char *name;
4622Proto *fp = getluaproto(ci);
4623if (fp && (name = luaF_getlocalname(fp, n, currentpc(L, ci))) != NULL)
4624return name; /* is a local variable in a Lua function */
4625else {
4626StkId limit = (ci == L->ci) ? L->top : (ci+1)->func;
4627if (limit - ci->base >= n && n > 0) /* is 'n' inside 'ci' stack? */
4628return "(*temporary)";
4629else
4630return NULL;
4631}
4632}
4633
4634
4635LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) {

Callers 2

lua_getlocalFunction · 0.85
lua_setlocalFunction · 0.85

Calls 3

getluaprotoFunction · 0.85
luaF_getlocalnameFunction · 0.85
currentpcFunction · 0.85

Tested by

no test coverage detected