lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



I sent the following email to team@lua.org on July 09 but didnt get a response from them.
I was wondering if anybody else has had this issue or if they know about whether the current implementation has a fix or not? Thanks,
saurabh
----

 This is with Lua 5.1.2. If in one's C code, SIGFPEs are enabled for invalid floating point operations (with fpsetmask(FP_X_INV) or feenableexcept(FE_INVALID) or ... depending on platform), a Lua script run using an app built on that C code throws an arithmetic exception when it uses numbers larger than INT_MAX. This is because Lua tries to stick the number into an int first. This happens in lua_number2int(k,n) with the following stack trace:

[1] luaH_get line 476 in "ltable.c"
[2] luaH_set line 495 in "ltable.c"
[3] addk line 231 in "lcode.c"
[4] luaK_numberK line 260 in "lcode.c"
[5] discharge2reg line 359 in "lcode.c"
[6] exp2reg line 391 in "lcode.c"
[7] luaK_exp2nextreg line 418 in "lcode.c"
[8] luaK_exp2anyreg line 431 in "lcode.c"
[9] luaK_storevar line 485 in "lcode.c"
[10] assignment line 954 in "lparser.c"

This seems to happen when the Lua script is parsed, before anything is executed, so perhaps Lua
needs to set those exceptions off when it begins parsing and revert their state when it finishes
parsing. Thanks.

 		 	   		  
_________________________________________________________________
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969