macros luai_num* take a state L (when available) as argument, to allow
them to generate errors (and other facilities)
This commit is contained in:
4
ltable.c
4
ltable.c
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: ltable.c,v 2.32 2006/01/18 11:49:02 roberto Exp roberto $
|
||||
** $Id: ltable.c,v 2.33 2006/07/11 15:53:29 roberto Exp roberto $
|
||||
** Lua tables (hash)
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@@ -494,7 +494,7 @@ TValue *luaH_set (lua_State *L, Table *t, const TValue *key) {
|
||||
return cast(TValue *, p);
|
||||
else {
|
||||
if (ttisnil(key)) luaG_runerror(L, "table index is nil");
|
||||
else if (ttisnumber(key) && luai_numisnan(nvalue(key)))
|
||||
else if (ttisnumber(key) && luai_numisnan(L, nvalue(key)))
|
||||
luaG_runerror(L, "table index is NaN");
|
||||
return newkey(L, t, key);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user