configuration for NaN trick big-endian + macro 'luai_checknum' to
ensure numbers comming from C are not "improper" (some kinds of signaling NaNs)
This commit is contained in:
4
lapi.c
4
lapi.c
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lapi.c,v 2.147 2011/05/31 18:27:56 roberto Exp roberto $
|
||||
** $Id: lapi.c,v 2.148 2011/06/02 19:31:40 roberto Exp roberto $
|
||||
** Lua API
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@@ -463,6 +463,8 @@ LUA_API void lua_pushnil (lua_State *L) {
|
||||
LUA_API void lua_pushnumber (lua_State *L, lua_Number n) {
|
||||
lua_lock(L);
|
||||
setnvalue(L->top, n);
|
||||
luai_checknum(L, L->top,
|
||||
luaG_runerror(L, "C API - attempt to push a signaling NaN"));
|
||||
api_incr_top(L);
|
||||
lua_unlock(L);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user