diff --git a/NEWS b/NEWS index 32062ccc298..1a81ed2da6e 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.2.0beta3 +- Core: + . Fixed --CGI-- support of run-tests.php. (cmb) + . Fixed incorrect double to long casting in latest clang. (zeriyoshi) + - Random: . Fixed bug GH-9235 (non-existant $sequence parameter in stub for PcgOneseq128XslRr64::__construct()). (timwolla) diff --git a/Zend/Zend.m4 b/Zend/Zend.m4 index fe28134dd92..fd00dc7270d 100644 --- a/Zend/Zend.m4 +++ b/Zend/Zend.m4 @@ -149,40 +149,6 @@ dnl Checks for library functions. AC_CHECK_FUNCS(getpid kill sigsetjmp) ZEND_CHECK_FLOAT_PRECISION - -dnl Test whether double cast to long preserves least significant bits. -AC_MSG_CHECKING(whether double cast to long preserves least significant bits) - -AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include -#include - -int main() -{ - if (sizeof(long) == 4) { - double d = (double) LONG_MIN * LONG_MIN + 2e9; - - if ((long) d == 2e9 && (long) -d == -2e9) { - return 0; - } - } else if (sizeof(long) == 8) { - double correct = 18e18 - ((double) LONG_MIN * -2); /* Subtract ULONG_MAX + 1 */ - - if ((long) 18e18 == correct) { /* On 64-bit, only check between LONG_MAX and ULONG_MAX */ - return 0; - } - } - return 1; -} -]])], [ - AC_DEFINE([ZEND_DVAL_TO_LVAL_CAST_OK], 1, [Define if double cast to long preserves least significant bits]) - AC_MSG_RESULT(yes) -], [ - AC_MSG_RESULT(no) -], [ - AC_MSG_RESULT(no) -]) - ]) dnl diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 3690162418f..9af1a6b4756 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -3539,8 +3539,7 @@ ZEND_API const char* ZEND_FASTCALL zend_memnrstr_ex(const char *haystack, const } /* }}} */ -#ifndef ZEND_DVAL_TO_LVAL_CAST_OK -# if SIZEOF_ZEND_LONG == 4 +#if SIZEOF_ZEND_LONG == 4 ZEND_API zend_long ZEND_FASTCALL zend_dval_to_lval_slow(double d) /* {{{ */ { double two_pow_32 = pow(2., 32.), @@ -3570,4 +3569,3 @@ ZEND_API zend_long ZEND_FASTCALL zend_dval_to_lval_slow(double d) } /* }}} */ #endif -#endif diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index 350612fe9db..0fc503f2c12 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -99,16 +99,6 @@ ZEND_API const char* ZEND_FASTCALL zend_memnrstr_ex(const char *haystack, const # define ZEND_DOUBLE_FITS_LONG(d) (!((d) >= (double)ZEND_LONG_MAX || (d) < (double)ZEND_LONG_MIN)) #endif -#ifdef ZEND_DVAL_TO_LVAL_CAST_OK -static zend_always_inline zend_long zend_dval_to_lval(double d) -{ - if (EXPECTED(zend_finite(d)) && EXPECTED(!zend_isnan(d))) { - return (zend_long)d; - } else { - return 0; - } -} -#else ZEND_API zend_long ZEND_FASTCALL zend_dval_to_lval_slow(double d); static zend_always_inline zend_long zend_dval_to_lval(double d) @@ -120,7 +110,6 @@ static zend_always_inline zend_long zend_dval_to_lval(double d) } return (zend_long)d; } -#endif /* Used to convert a string float to integer during an (int) cast */ static zend_always_inline zend_long zend_dval_to_lval_cap(double d)