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