| 91 | |
| 92 | |
| 93 | LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar) { |
| 94 | int status; |
| 95 | CallInfo *ci; |
| 96 | if (level < 0) return 0; /* invalid (negative) level */ |
| 97 | lua_lock(L); |
| 98 | for (ci = L->ci; level > 0 && ci != &L->base_ci; ci = ci->previous) |
| 99 | level--; |
| 100 | if (level == 0 && ci != &L->base_ci) { /* level found? */ |
| 101 | status = 1; |
| 102 | ar->i_ci = ci; |
| 103 | } |
| 104 | else status = 0; /* no such level */ |
| 105 | lua_unlock(L); |
| 106 | return status; |
| 107 | } |
| 108 | |
| 109 | |
| 110 | static const char *upvalname (Proto *p, int uv) { |
no outgoing calls
no test coverage detected