MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / lua_setfield

Function lua_setfield

ogsr_engine/LuaJIT/src/lj_api.c:979–997  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

977}
978
979LUA_API void lua_setfield(lua_State *L, int idx, const char *k)
980{
981 TValue *o;
982 TValue key;
983 cTValue *t = index2adr_check(L, idx);
984 lj_checkapi_slot(1);
985 setstrV(L, &key, lj_str_newz(L, k));
986 o = lj_meta_tset(L, t, &key);
987 if (o) {
988 /* NOBARRIER: lj_meta_tset ensures the table is not black. */
989 copyTV(L, o, --L->top);
990 } else {
991 TValue *base = L->top;
992 copyTV(L, base+2, base-3-2*LJ_FR2);
993 L->top = base+3;
994 lj_vm_call(L, base, 0+1);
995 L->top -= 2+LJ_FR2;
996 }
997}
998
999LUA_API void lua_rawset(lua_State *L, int idx)
1000{

Callers 15

luaopen_stringFunction · 0.70
io_std_newFunction · 0.70
luaopen_ioFunction · 0.70
settabssFunction · 0.70
settabsiFunction · 0.70
settabsbFunction · 0.70
treatstackoptionFunction · 0.70
luaopen_mathFunction · 0.70
luaopen_tableFunction · 0.70
pmainFunction · 0.70
lib_jit.cFile · 0.70
luaL_pushmoduleFunction · 0.70

Calls 3

index2adr_checkFunction · 0.85
lj_meta_tsetFunction · 0.85
copyTVFunction · 0.85

Tested by

no test coverage detected