Re: Bug in math.random() range checking
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Bug in math.random() range checking
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 1 Mar 2018 09:31:13 -0300
> > > luaL_argcheck(L, up - low + 1 <= L_RANDMAX, 1, "interval too large");
>
> up - low isn't representable when the difference is greater than
> LUA_MAXINTEGER.
we have to cast all operands to LUA_UNSIGNED.
-- Roberto