MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / lua_getinfo

Function lua_getinfo

Source/Misc/lua/src/lua.c:4740–4767  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4738
4739
4740LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) {
4741int status;
4742Closure *f = NULL;
4743CallInfo *ci = NULL;
4744lua_lock(L);
4745if (*what == '>') {
4746StkId func = L->top - 1;
4747luai_apicheck(L, ttisfunction(func));
4748what++; /* skip the '>' */
4749f = clvalue(func);
4750L->top--; /* pop function */
4751}
4752else if (ar->i_ci != 0) { /* no tail call? */
4753ci = L->base_ci + ar->i_ci;
4754lua_assert(ttisfunction(ci->func));
4755f = clvalue(ci->func);
4756}
4757status = auxgetinfo(L, what, ar, f, ci);
4758if (strchr(what, 'f')) {
4759if (f == NULL) setnilvalue(L->top);
4760else setclvalue(L, L->top, f);
4761incr_top(L);
4762}
4763if (strchr(what, 'L'))
4764collectvalidlines(L, f);
4765lua_unlock(L);
4766return status;
4767}
4768
4769
4770/*

Callers 8

luaL_argerrorFunction · 0.85
luaL_whereFunction · 0.85
getfuncFunction · 0.85
db_getinfoFunction · 0.85
hookfFunction · 0.85
db_errorfbFunction · 0.85
setfenvFunction · 0.85
add_file_and_lineFunction · 0.85

Calls 2

auxgetinfoFunction · 0.85
collectvalidlinesFunction · 0.85

Tested by

no test coverage detected