[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.2 Truncation error in lua_tointeger
- From: liam mail <liam.list@...>
- Date: Tue, 24 Apr 2012 20:21:19 +0100
On 8 April 2012 16:35, liam mail <liam.list@googlemail.com> wrote:
> When using the ieee754 trick on an x86_64 machine where
> sizeof(lua_Integer) ==8 and sizeof(int) == 4, the following fails in
> 5.2 yet passes in 5.1
>
> CPPUNIT_ASSERT(sizeof(lua_Integer) == 8);
> CPPUNIT_ASSERT(sizeof(int) == 4);
> lua_Integer input = 0x1ffffffff;
> lua_pushinteger(l, input );
> CPPUNIT_ASSERT_EQUAL(input,lua_tointeger(l,1));
>
>
> This is due to lua_number2integer when LUA_IEEE754TRICK is defined and
> called by lua_tointegerx
> #define lua_number2integer(i,n) lua_number2int32(i, n, lua_Integer)
>
> Liam
Would I be correct to assume by the lack of replies and that it is
also not listed on the bugs page, that this is not considered a bug?
If so could someone please explain why?
Thanks
Liam