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

Function lua_getlocal

third-party/lua-5.2.4/src/ldebug.c:154–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152
153
154LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) {
155 const char *name;
156 lua_lock(L);
157 swapextra(L);
158 if (ar == NULL) { /* information about non-active function? */
159 if (!isLfunction(L->top - 1)) /* not a Lua function? */
160 name = NULL;
161 else /* consider live variables at function start (parameters) */
162 name = luaF_getlocalname(clLvalue(L->top - 1)->p, n, 0);
163 }
164 else { /* active function; get information through 'ar' */
165 StkId pos = 0; /* to avoid warnings */
166 name = findlocal(L, ar->i_ci, n, &pos);
167 if (name) {
168 setobj2s(L, L->top, pos);
169 api_incr_top(L);
170 }
171 }
172 swapextra(L);
173 lua_unlock(L);
174 return name;
175}
176
177
178LUA_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