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:
Roberto Ierusalimschy
2006-08-07 16:14:30 -03:00
parent ca7e5b5cb6
commit dfe2f1eeff
4 changed files with 38 additions and 38 deletions

View File

@@ -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);
}