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