diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-06-13 11:13:06 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-06-13 11:13:06 -0300 |
commit | fd80e63468f0c08fedd8dbf944fa4954b72d7384 (patch) | |
tree | e074a257d1eb265eaaafeb930e94282a72d27f88 /lapi.c | |
parent | f62565abea4e56f6bd064df83e5b0f3818b99d82 (diff) | |
download | lua-fd80e63468f0c08fedd8dbf944fa4954b72d7384.tar.gz lua-fd80e63468f0c08fedd8dbf944fa4954b72d7384.tar.bz2 lua-fd80e63468f0c08fedd8dbf944fa4954b72d7384.zip |
configuration for NaN trick big-endian + macro 'luai_checknum' to
ensure numbers comming from C are not "improper" (some kinds of
signaling NaNs)
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 2.147 2011/05/31 18:27:56 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.148 2011/06/02 19:31:40 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -463,6 +463,8 @@ LUA_API void lua_pushnil (lua_State *L) { | |||
463 | LUA_API void lua_pushnumber (lua_State *L, lua_Number n) { | 463 | LUA_API void lua_pushnumber (lua_State *L, lua_Number n) { |
464 | lua_lock(L); | 464 | lua_lock(L); |
465 | setnvalue(L->top, n); | 465 | setnvalue(L->top, n); |
466 | luai_checknum(L, L->top, | ||
467 | luaG_runerror(L, "C API - attempt to push a signaling NaN")); | ||
466 | api_incr_top(L); | 468 | api_incr_top(L); |
467 | lua_unlock(L); | 469 | lua_unlock(L); |
468 | } | 470 | } |