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

Function luaH_set

other_src/lua/src/ltable.cpp:522–536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

520
521
522TValue *luaH_set (lua_State *L, Table *t, const TValue *key) {
523 const TValue *p = luaH_get(t, key);
524 t->flags = 0;
525 if (p != luaO_nilobject) {
526 check_readonlyold(L, t, cast(TValue *, p)); /*BZ*/
527 return cast(TValue *, p);
528 }
529 else {
530 check_readonlynew(L, t); /*BZ*/
531 if (ttisnil(key)) luaG_runerror(L, "table index is nil");
532 else if (ttisnumber(key) && luai_numisnan(nvalue(key)))
533 luaG_runerror(L, "table index is NaN");
534 return newkey(L, t, key);
535 }
536}
537
538
539TValue *luaH_setnum (lua_State *L, Table *t, int key) {

Callers 5

addkFunction · 0.70
luaV_settableFunction · 0.70
resizeFunction · 0.70
newkeyFunction · 0.70
lua_rawsetFunction · 0.70

Calls 3

luaH_getFunction · 0.70
luaG_runerrorFunction · 0.70
newkeyFunction · 0.70

Tested by

no test coverage detected