MCPcopy Create free account
hub / github.com/DFHack/dfhack / lua_getstack

Function lua_getstack

depends/lua/src/ldebug.c:110–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108
109
110LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar) {
111 int status;
112 CallInfo *ci;
113 if (level < 0) return 0; /* invalid (negative) level */
114 lua_lock(L);
115 for (ci = L->ci; level > 0 && ci != &L->base_ci; ci = ci->previous)
116 level--;
117 if (level == 0 && ci != &L->base_ci) { /* level found? */
118 status = 1;
119 ar->i_ci = ci;
120 }
121 else status = 0; /* no such level */
122 lua_unlock(L);
123 return status;
124}
125
126
127static const char *upvalname (Proto *p, int uv) {

Callers 9

lastlevelFunction · 0.85
luaL_tracebackFunction · 0.85
luaL_argerrorFunction · 0.85
luaL_whereFunction · 0.85
luaB_costatusFunction · 0.85
set_envFunction · 0.85
db_getinfoFunction · 0.85
db_getlocalFunction · 0.85
db_setlocalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected