[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.3w2 Test Suite Issues
- From: Paige DePol <lual@...>
- Date: Mon, 31 Mar 2014 18:18:27 -0500
On Mar 31, 2014, at 6:03 PM, Doug Currie <doug.currie@gmail.com> wrote:
> On Mon, Mar 31, 2014 at 6:33 PM, Paige DePol <lual@serfnet.org> wrote:
> ... I favour adding the sanity check to lua_checkstack() as it potentially helps prevent future issues should a negative value be passed for 'size'. My fix simply adds one line to lua_checkstack() and changes one comparison in unpack() to fix the issue as well.
>
> The only argument I have against the change in lua_checkstack() is that it is not necessary, and may affect things I don't understand. [It also uses new C99 features, which is easily fixed.]
>
> The unpack solution happens to work for this compiler, but uses unspecified compiler behavior since the subtraction still overflows. So, it is not portable.
>
> e
Upon further reading I think I have a better understanding of the arithmetic overflow issues with respect to signed vs unsigned numbers. Your solution should be the most portable and I will update my patch to use it, thank you!
However, I also think that lua_checkstack() should have some sort of sanity check for negative values as the function does seem to assume that 'size' will always be zero or greater. Which new C99 features does it use, btw?
~Paige