lua: fix integer overflow in LNUM patch
authorAdam Bailey <aebailey@gmail.com>
Tue, 4 Jul 2023 01:16:14 +0000 (20:16 -0500)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 8 Jul 2023 14:56:12 +0000 (16:56 +0200)
commit3a2e7c30d3e6a187ba1df740cdb24c8ad84dfe48
tree2eab21c363101dda734e9815631fdde4561ef443
parentc170fc78ba6e4477cc06b2b77e11747da862dcf0
lua: fix integer overflow in LNUM patch

Safely detect integer overflow in try_addint() and try_subint().
Old code relied on undefined behavior, and recent versions of GCC on x86
optimized away the if-statements.
This caused integer overflow in Lua code instead of falling back to
floating-point numbers.

Signed-off-by: Adam Bailey <aebailey@gmail.com>
package/utils/lua/patches-host/010-lua-5.1.3-lnum-full-260308.patch
package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch