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

Function lua_getinfo

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

Source from the content-addressed store, hash-verified

275
276
277LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) {
278 int status;
279 Closure *cl;
280 CallInfo *ci;
281 StkId func;
282 lua_lock(L);
283 swapextra(L);
284 if (*what == '>') {
285 ci = NULL;
286 func = L->top - 1;
287 api_check(L, ttisfunction(func), "function expected");
288 what++; /* skip the '>' */
289 L->top--; /* pop function */
290 }
291 else {
292 ci = ar->i_ci;
293 func = ci->func;
294 lua_assert(ttisfunction(ci->func));
295 }
296 cl = ttisclosure(func) ? clvalue(func) : NULL;
297 status = auxgetinfo(L, what, ar, cl, ci);
298 if (strchr(what, 'f')) {
299 setobjs2s(L, L->top, func);
300 api_incr_top(L);
301 }
302 swapextra(L);
303 if (strchr(what, 'L'))
304 collectvalidlines(L, cl);
305 lua_unlock(L);
306 return status;
307}
308
309
310/*

Callers 4

pushglobalfuncnameFunction · 0.70
luaL_tracebackFunction · 0.70
luaL_argerrorFunction · 0.70
luaL_whereFunction · 0.70

Calls 4

swapextraFunction · 0.85
strchrFunction · 0.85
auxgetinfoFunction · 0.70
collectvalidlinesFunction · 0.70

Tested by

no test coverage detected