From bddbed9da2bd192d7e59c200e3a2af9df0d183fc Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 16 Dec 2019 10:14:11 +0800 Subject: [PATCH] Sanity check for Lua integer size --- code/ryzom/client/src/r2/dmc/com_lua_module.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/ryzom/client/src/r2/dmc/com_lua_module.cpp b/code/ryzom/client/src/r2/dmc/com_lua_module.cpp index 18ecbe011..c717b2cba 100644 --- a/code/ryzom/client/src/r2/dmc/com_lua_module.cpp +++ b/code/ryzom/client/src/r2/dmc/com_lua_module.cpp @@ -1243,6 +1243,7 @@ CObject* CComLuaModule::getObjectFromLua(lua_State* state, sint idx) #if LUA_VERSION_NUM >= 503 if (lua_isinteger(state, -1) != 0) { + nlctassert(sizeof(lua_Integer) == sizeof(sint64)); sint64 value = lua_tointeger(state, -1); lua_pop(state, 1); return new CObjectNumber(value); @@ -1250,6 +1251,7 @@ CObject* CComLuaModule::getObjectFromLua(lua_State* state, sint idx) else #endif { + nlctassert(sizeof(lua_Number) == sizeof(double)); double value = lua_tonumber(state, -1); lua_pop(state, 1); return new CObjectNumber(value);