lua-users home
lua-l archive

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


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