| 520 | |
| 521 | |
| 522 | TValue *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 | |
| 539 | TValue *luaH_setnum (lua_State *L, Table *t, int key) { |
no test coverage detected