Re: lua crashes with 64-bit integers (Todor Totev)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: lua crashes with 64-bit integers (Todor Totev)

John D. Ramsdell-2
> From: "Todor Totev" <[hidden email]>
> Subject: lua crashes with 64-bit integers
> Hello all,
> i'm using Lua 5.0.2 with lua_Number defined as __int64
> (Microsoft VC under Windows NT).
> Now, the simple expression
> 
> =1/0
> 
> crashes Lua interpreter with Division by zero exception.

If you switch to using Lua 5.1.1, the patch at

http://www.ccs.neu.edu/home/ramsdell/tools/lua-5.1-no-fp.patch

sets up Lua with lua_Number defined as long, and avoids all floating
point operations.  The patched version has been working quite well for
me.

John

Reply | Threaded
Open this post in threaded view
|

Re: lua crashes with 64-bit integers (Todor Totev)

Todor Totev
i'm using Lua 5.0.2 with lua_Number defined as __int64
Now, the simple expression
=1/0
crashes Lua interpreter with Division by zero exception.

If you switch to using Lua 5.1.1, the patch at
http://www.ccs.neu.edu/home/ramsdell/tools/lua-5.1-no-fp.patch
sets up Lua with lua_Number defined as long, and avoids all floating
point operations.  The patched version has been working quite well for
me.

I can't switch to 5.1 but the patch was very useful for me because I've
completely forgotten to patch the code for %G etc.
Thank you very much,
Todor