MCPcopy Create free account
hub / github.com/defold/defold / lua_getinfo

Function lua_getinfo

engine/lua/src/lua/ldebug.c:232–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230
231
232LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) {
233 int status;
234 Closure *f = NULL;
235 CallInfo *ci = NULL;
236 lua_lock(L);
237 if (*what == '>') {
238 StkId func = L->top - 1;
239 luai_apicheck(L, ttisfunction(func));
240 what++; /* skip the '>' */
241 f = clvalue(func);
242 L->top--; /* pop function */
243 }
244 else if (ar->i_ci != 0) { /* no tail call? */
245 ci = L->base_ci + ar->i_ci;
246 lua_assert(ttisfunction(ci->func));
247 f = clvalue(ci->func);
248 }
249 status = auxgetinfo(L, what, ar, f, ci);
250 if (strchr(what, 'f')) {
251 if (f == NULL) setnilvalue(L->top);
252 else setclvalue(L, L->top, f);
253 incr_top(L);
254 }
255 if (strchr(what, 'L'))
256 collectvalidlines(L, f);
257 lua_unlock(L);
258 return status;
259}
260
261
262/*

Callers 10

GetLuaTracebackFunction · 0.85
GetLuaFunctionRefInfoFunction · 0.85
getfuncFunction · 0.85
luaL_argerrorFunction · 0.85
luaL_whereFunction · 0.85
setfenvFunction · 0.85
db_getinfoFunction · 0.85
hookfFunction · 0.85
db_errorfbFunction · 0.85

Calls 2

auxgetinfoFunction · 0.85
collectvalidlinesFunction · 0.85

Tested by

no test coverage detected