1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00

Finish reverting gmp_pow overflow check

This commit is contained in:
David Carlier
2024-11-27 21:18:08 +00:00
committed by Gina Peter Banyard
parent 0833f2376e
commit 424ba0f2ff

View File

@@ -1140,14 +1140,7 @@ ZEND_FUNCTION(gmp_pow)
RETURN_THROWS();
}
double powmax = log((double)ZEND_LONG_MAX);
INIT_GMP_RETVAL(gmpnum_result);
zend_ulong gmpnum = mpz_get_ui(gmpnum_base);
if ((log(gmpnum) * exp) > powmax) {
zend_value_error("base and exponent overflow");
RETURN_THROWS();
}
mpz_pow_ui(gmpnum_result, gmpnum_base, exp);
}
/* }}} */