Dmitry,
after spending more time on this issue I came to the conclusion it
shouldn't be touched :) . The __x86_64__ you've mentioned is solvable on
compile time using a macros like this
defined(PHP_WIN32) || ((defined(__i386__) || defined(__i386)) &&
defined(__STDC_IEC_559__))
so either old or
On Fri, March 22, 2013 10:08, Dmitry Stogov wrote:
> Thanks, now I understood. :)
>
>
> anyway I see a problem. For example on x86_64 double is not always able
> to keep a long number without precision lost. May be you should receive
> arguments as zvals and use old or new code depending on input t
Thanks, now I understood. :)
anyway I see a problem. For example on x86_64 double is not always able to
keep a long number without precision lost.
May be you should receive arguments as zvals and use old or new code
depending on input types.
BTW: I'm not sure if rand() should be fixed at all.
Acc
Dmitry,
first of all thanks for taking a look :)
The issue in a few words
- mt_rand reads arguments as long
- user pass a float from the userspace
- zend_parse_parameters with 'l' casts to long
Here's the essential snippet
echo mt_rand(0,pow(10,12));
PHP Warning: mt_rand(): max(-727379968) is s