| 82 | |
| 83 | |
| 84 | static StkId index2stack (lua_State *L, int idx) { |
| 85 | CallInfo *ci = L->ci; |
| 86 | if (idx > 0) { |
| 87 | StkId o = ci->func + idx; |
| 88 | api_check(L, o < L->top, "unacceptable index"); |
| 89 | return o; |
| 90 | } |
| 91 | else { /* non-positive index */ |
| 92 | api_check(L, idx != 0 && -idx <= L->top - (ci->func + 1), "invalid index"); |
| 93 | api_check(L, !ispseudo(idx), "invalid index"); |
| 94 | return L->top + idx; |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | |
| 99 | LUA_API int lua_checkstack (lua_State *L, int n) { |
no outgoing calls
no test coverage detected