MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / index2stack

Function index2stack

third-party/lua-5.5.0/src/lapi.c:93–106  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers 4

lua_closeslotFunction · 0.70
lua_rotateFunction · 0.70
lua_pcallkFunction · 0.70
lua_tocloseFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected