MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / lua_replace

Function lua_replace

lua/lapi.c: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 8

generic_readerFunction · 0.85
luaB_xpcallFunction · 0.85
gmatch_auxFunction · 0.85
luabb_typeconvertFunction · 0.85
luaL_checklstringFunction · 0.85
sp_column_ptrFunction · 0.85
luaopen_packageFunction · 0.85
luaopen_ioFunction · 0.85

Calls 2

luaG_runerrorFunction · 0.85
index2adrFunction · 0.85

Tested by

no test coverage detected