| 108 | |
| 109 | |
| 110 | LUA_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 | |
| 127 | static const char *upvalname (Proto *p, int uv) { |
no outgoing calls
no test coverage detected