MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / lua_getinfo

Function lua_getinfo

src/Chain/libraries/glua/ldebug.cpp:322–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

320
321
322LUA_API int lua_getinfo(lua_State *L, const char *what, lua_Debug *ar) {
323 int status;
324 Closure *cl;
325 CallInfo *ci;
326 StkId func;
327 lua_lock(L);
328 swapextra(L);
329 if (*what == '>') {
330 ci = nullptr;
331 func = L->top - 1;
332 api_check(L, ttisfunction(func), "function expected");
333 what++; /* skip the '>' */
334 L->top--; /* pop function */
335 }
336 else {
337 ci = ar->i_ci;
338 func = ci->func;
339 lua_assert(ttisfunction(ci->func));
340 }
341 cl = ttisclosure(func) ? clvalue(func) : nullptr;
342 status = auxgetinfo(L, what, ar, cl, ci);
343 if (strchr(what, 'f')) {
344 setobjs2s(L, L->top, func);
345 api_incr_top(L);
346 }
347 swapextra(L); /* correct before option 'L', which can raise a mem. error */
348 if (strchr(what, 'L'))
349 collectvalidlines(L, cl);
350 lua_unlock(L);
351 return status;
352}
353
354
355/*

Callers 7

set_envFunction · 0.85
pushglobalfuncnameFunction · 0.85
luaL_tracebackFunction · 0.85
luaL_argerrorFunction · 0.85
luaL_whereFunction · 0.85
db_getinfoFunction · 0.85
hookfFunction · 0.85

Calls 3

swapextraFunction · 0.85
auxgetinfoFunction · 0.85
collectvalidlinesFunction · 0.85

Tested by

no test coverage detected