MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / index2stack

Function index2stack

lib/lua/src/lapi.c:95–108  ·  view source on GitHub ↗

** Convert a valid actual index (not a pseudo-index) to its address. */

Source from the content-addressed store, hash-verified

93** Convert a valid actual index (not a pseudo-index) to its address.
94*/
95l_sinline StkId index2stack (lua_State *L, int idx) {
96 CallInfo *ci = L->ci;
97 if (idx > 0) {
98 StkId o = ci->func.p + idx;
99 api_check(L, o < L->top.p, "invalid index");
100 return o;
101 }
102 else { /* non-positive index */
103 api_check(L, idx != 0 && -idx <= L->top.p - (ci->func.p + 1),
104 "invalid index");
105 api_check(L, !ispseudo(idx), "invalid index");
106 return L->top.p + idx;
107 }
108}
109
110
111LUA_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