MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / lua_replace

Function lua_replace

other_src/lua/src/lapi.cpp:204–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202
203
204LUA_API void lua_replace (lua_State *L, int idx) {
205 StkId o;
206 lua_lock(L);
207 /* explicit test for incompatible code */
208 if (idx == LUA_ENVIRONINDEX && L->ci == L->base_ci)
209 luaG_runerror(L, "no calling environment");
210 api_checknelems(L, 1);
211 o = index2adr(L, idx);
212 api_checkvalidindex(L, o);
213 if (idx == LUA_ENVIRONINDEX) {
214 Closure *func = curr_func(L);
215 api_check(L, ttistable(L->top - 1));
216 func->c.env = hvalue(L->top - 1);
217 luaC_barrier(L, func, L->top - 1);
218 }
219 else {
220 setobj(L, o, L->top - 1);
221 if (idx < LUA_GLOBALSINDEX) /* function upvalue? */
222 luaC_barrier(L, curr_func(L), L->top - 1);
223 }
224 L->top--;
225 lua_unlock(L);
226}
227
228
229LUA_API void lua_pushvalue (lua_State *L, int idx) {

Callers 11

luaopen_packageFunction · 0.70
doublecapFunction · 0.70
doublestackFunction · 0.70
fix_lFunction · 0.70
getpattFunction · 0.70
updatecache_Function · 0.70
gmatch_auxFunction · 0.70
luaopen_ioFunction · 0.70
generic_readerFunction · 0.70
luaB_xpcallFunction · 0.70
RenderModeMethod · 0.50

Calls 2

luaG_runerrorFunction · 0.70
index2adrFunction · 0.70

Tested by

no test coverage detected