lua-users home
lua-l archive

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


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