[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [PATCH] Loop Overflow Bug Fix
- From: dyngeccetor8 <dyngeccetor8@...>
- Date: Wed, 15 Nov 2017 22:19:43 +0000
On 11/15/2017 06:48 AM, Paige DePol wrote:
> I have produced a very small patch which only makes adjustments in lvm.c to the OP_FORLOOP and OP_FORPREP opcodes to solve the issue of the edge case where math.maxinteger or math.mininteger are used, or where the sign bit overflowed.
Well, your patch broke version detection test from KHMan.
Now I can not reproduce cycle going out of limits:
> for i = math.maxinteger, math.maxinteger do print(i) end
9223372036854775807
> for i = math.maxinteger, math.maxinteger - 2, -1 do print(i) end
9223372036854775807
9223372036854775806
9223372036854775805
> for i = math.mininteger, math.mininteger + 2, 1 do print(i) end
-9223372036854775808
-9223372036854775807
-9223372036854775806
(Thank you for patch.)
-- Martin