MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / lua_getlocal

Function lua_getlocal

extlibs/lua/src/ldebug.c:226–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

db_getlocalFunction · 0.85

Calls 2

luaF_getlocalnameFunction · 0.85
luaG_findlocalFunction · 0.85

Tested by

no test coverage detected