MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / index2stack

Function index2stack

3rd/lua-5.4.3/src/lapi.c:84–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82
83
84static 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
99LUA_API int lua_checkstack (lua_State *L, int n) {

Callers 4

lua_closeslotFunction · 0.85
lua_rotateFunction · 0.85
lua_pcallkFunction · 0.85
lua_tocloseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected