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

Function lua_getlocal

third-party/lua-5.5.0/src/ldebug.c:222–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220
221
222LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) {
223 const char *name;
224 lua_lock(L);
225 if (ar == NULL) { /* information about non-active function? */
226 if (!isLfunction(s2v(L->top.p - 1))) /* not a Lua function? */
227 name = NULL;
228 else /* consider live variables at function start (parameters) */
229 name = luaF_getlocalname(clLvalue(s2v(L->top.p - 1))->p, n, 0);
230 }
231 else { /* active function; get information through 'ar' */
232 StkId pos = NULL; /* to avoid warnings */
233 name = luaG_findlocal(L, ar->i_ci, n, &pos);
234 if (name) {
235 setobjs2s(L, L->top.p, pos);
236 api_incr_top(L);
237 }
238 }
239 lua_unlock(L);
240 return name;
241}
242
243
244LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) {

Callers 4

db_getlocalFunction · 0.70
GetStacksMethod · 0.50
DisplayFunction54Function · 0.50
CreateEnvMethod · 0.50

Calls 2

luaF_getlocalnameFunction · 0.70
luaG_findlocalFunction · 0.70

Tested by

no test coverage detected