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

Function lua_replace

third-party/lua-5.1.5/src/lapi.c:203–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 14

generic_readerFunction · 0.70
luaB_xpcallFunction · 0.70
gmatch_auxFunction · 0.70
luaopen_packageFunction · 0.70
luaopen_ioFunction · 0.70
generic_readerFunction · 0.50
writerFunction · 0.50
findfieldFunction · 0.50
io_linesFunction · 0.50
generic_readerFunction · 0.50
findfieldFunction · 0.50
io_linesFunction · 0.50

Calls 2

index2adrFunction · 0.85
luaG_runerrorFunction · 0.70

Tested by

no test coverage detected