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

Function lua_settop

third-party/lua-5.3.5/src/lapi.c:172–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170
171
172LUA_API void lua_settop (lua_State *L, int idx) {
173 StkId func = L->ci->func;
174 lua_lock(L);
175 if (idx >= 0) {
176 api_check(L, idx <= L->stack_last - (func + 1), "new top too large");
177 while (L->top < (func + 1) + idx)
178 setnilvalue(L->top++);
179 L->top = (func + 1) + idx;
180 }
181 else {
182 api_check(L, -(idx+1) <= (L->top - (func + 1)), "invalid new top");
183 L->top += idx+1; /* 'subtract' index (index is negative) */
184 }
185 lua_unlock(L);
186}
187
188
189/*

Callers 15

loadlineFunction · 0.70
doREPLFunction · 0.70
luaB_tonumberFunction · 0.70
luaB_errorFunction · 0.70
luaB_setmetatableFunction · 0.70
luaB_rawgetFunction · 0.70
luaB_rawsetFunction · 0.70
luaB_nextFunction · 0.70
luaB_loadFunction · 0.70
luaB_dofileFunction · 0.70
luaB_assertFunction · 0.70
math_floorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected