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

Function lua_getstack

Source/Misc/lua/src/lua.c:4592–4612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4590
4591
4592LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar) {
4593int status;
4594CallInfo *ci;
4595lua_lock(L);
4596for (ci = L->ci; level > 0 && ci > L->base_ci; ci--) {
4597level--;
4598if (f_isLua(ci)) /* Lua function? */
4599level -= ci->tailcalls; /* skip lost tail calls */
4600}
4601if (level == 0 && ci > L->base_ci) { /* level found? */
4602status = 1;
4603ar->i_ci = cast_int(ci - L->base_ci);
4604}
4605else if (level < 0) { /* level is of a lost tail call? */
4606status = 1;
4607ar->i_ci = 0;
4608}
4609else status = 0; /* no such level */
4610lua_unlock(L);
4611return status;
4612}
4613
4614
4615static Proto *getluaproto (CallInfo *ci) {

Callers 10

luaL_argerrorFunction · 0.85
luaL_whereFunction · 0.85
getfuncFunction · 0.85
costatusFunction · 0.85
db_getinfoFunction · 0.85
db_getlocalFunction · 0.85
db_setlocalFunction · 0.85
db_errorfbFunction · 0.85
setfenvFunction · 0.85
add_file_and_lineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected