diff options
| -rw-r--r-- | ltable.c | 4 |
1 files changed, 3 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltable.c,v 1.111 2002/06/24 20:18:38 roberto Exp roberto $ | 2 | ** $Id: ltable.c,v 1.112 2002/07/01 19:31:10 roberto Exp roberto $ |
| 3 | ** Lua tables (hash) | 3 | ** Lua tables (hash) |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -468,6 +468,8 @@ TObject *luaH_set (lua_State *L, Table *t, const TObject *key) { | |||
| 468 | return cast(TObject *, p); | 468 | return cast(TObject *, p); |
| 469 | else { | 469 | else { |
| 470 | if (ttype(key) == LUA_TNIL) luaG_runerror(L, "table index is nil"); | 470 | if (ttype(key) == LUA_TNIL) luaG_runerror(L, "table index is nil"); |
| 471 | else if (ttype(key) == LUA_TNUMBER && nvalue(key) != nvalue(key)) | ||
| 472 | luaG_runerror(L, "table index is NaN"); | ||
| 471 | return newkey(L, t, key); | 473 | return newkey(L, t, key); |
| 472 | } | 474 | } |
| 473 | } | 475 | } |
