lua-users home
lua-l archive

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




On 2017-11-15 08:34 PM, Paige DePol wrote:
Sorry for the noise... I meant to upload an optimised version of the patch
with the last post to this list! :[

The patch attached to this post has a small optimisation vs the previously
posted patch; the limit check has simply been replaced with the step size
check. This can be done as a limit bounds check is added to OP_FORPREP with
the patch to check if the loop should iterate at all. This new step size
check simply adds one numeric subtraction each loop iteration, well, and a
negation of 'step' for loops with negative step values.

Again, sorry for the noise, this should be the final patch in relation to
fixing the 'for' loop overflows in Lua... hopefully! ;)

~Paige


What happens if you use excessively large loop steps?

--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.