Source-Changes-D archive

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

Re: CVS commit: src/external/mit/lua/dist/src



Lourival Pereira Vieira Neto wrote:
> Module Name:  src
> Committed By: lneto
> Date:         Sat Jul 19 17:11:53 UTC 2014
> 
> Modified Files:
>       src/external/mit/lua/dist/src: luaconf.h
> 
> Log Message:
> lua(4): preventing division by zero
> 
> * note: we should raise an error instead of return INTMAX_MAX

Userspace lua returns +inf or -inf. So, something like this would
be even better than your change:

#define luai_numdiv(a,b) \
        ((b) != 0 ? (a)/(b) : (a) > 0 ?  INTMAX_MAX : INTMAX_MIN)

Alex


Home | Main Index | Thread Index | Old Index