MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / index2stack

Function index2stack

extlibs/lua/src/lapi.c:83–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 3

lua_rotateFunction · 0.85
lua_pcallkFunction · 0.85
lua_tocloseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected