MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / findlocal

Function findlocal

deps/lua/src/ldebug.c:112–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110
111
112static const char *findlocal (lua_State *L, CallInfo *ci, int n) {
113 const char *name;
114 Proto *fp = getluaproto(ci);
115 if (fp && (name = luaF_getlocalname(fp, n, currentpc(L, ci))) != NULL)
116 return name; /* is a local variable in a Lua function */
117 else {
118 StkId limit = (ci == L->ci) ? L->top : (ci+1)->func;
119 if (limit - ci->base >= n && n > 0) /* is 'n' inside 'ci' stack? */
120 return "(*temporary)";
121 else
122 return NULL;
123 }
124}
125
126
127LUA_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