MCPcopy Create free account
hub / github.com/F-Stack/f-stack / lua_getlocal

Function lua_getlocal

freebsd/contrib/openzfs/module/lua/ldebug.c:150–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

swapextraFunction · 0.85
luaF_getlocalnameFunction · 0.70
findlocalFunction · 0.70

Tested by

no test coverage detected