MCPcopy Create free account
hub / github.com/F-Stack/f-stack / lua_getstack

Function lua_getstack

app/redis-6.2.6/deps/lua/src/ldebug.c:84–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82
83
84LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar) {
85 int status;
86 CallInfo *ci;
87 lua_lock(L);
88 for (ci = L->ci; level > 0 && ci > L->base_ci; ci--) {
89 level--;
90 if (f_isLua(ci)) /* Lua function? */
91 level -= ci->tailcalls; /* skip lost tail calls */
92 }
93 if (level == 0 && ci > L->base_ci) { /* level found? */
94 status = 1;
95 ar->i_ci = cast_int(ci - L->base_ci);
96 }
97 else if (level < 0) { /* level is of a lost tail call? */
98 status = 1;
99 ar->i_ci = 0;
100 }
101 else status = 0; /* no such level */
102 lua_unlock(L);
103 return status;
104}
105
106
107static Proto *getluaproto (CallInfo *ci) {

Callers 14

getfuncFunction · 0.70
costatusFunction · 0.70
luaL_argerrorFunction · 0.70
luaL_whereFunction · 0.70
setfenvFunction · 0.70
db_getinfoFunction · 0.70
db_getlocalFunction · 0.70
db_setlocalFunction · 0.70
db_errorfbFunction · 0.70
luaPushErrorFunction · 0.50
ldbPrintFunction · 0.50
ldbPrintAllFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected