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

Function lua_getlocal

third-party/lua-5.3.5/src/ldebug.c:171–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169
170
171LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) {
172 const char *name;
173 lua_lock(L);
174 swapextra(L);
175 if (ar == NULL) { /* information about non-active function? */
176 if (!isLfunction(L->top - 1)) /* not a Lua function? */
177 name = NULL;
178 else /* consider live variables at function start (parameters) */
179 name = luaF_getlocalname(clLvalue(L->top - 1)->p, n, 0);
180 }
181 else { /* active function; get information through 'ar' */
182 StkId pos = NULL; /* to avoid warnings */
183 name = findlocal(L, ar->i_ci, n, &pos);
184 if (name) {
185 setobj2s(L, L->top, pos);
186 api_incr_top(L);
187 }
188 }
189 swapextra(L);
190 lua_unlock(L);
191 return name;
192}
193
194
195LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) {

Callers 1

db_getlocalFunction · 0.70

Calls 3

swapextraFunction · 0.70
luaF_getlocalnameFunction · 0.70
findlocalFunction · 0.70

Tested by

no test coverage detected