We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b9b832 commit a1900c6Copy full SHA for a1900c6
ext/gmp/gmp.c
@@ -1142,15 +1142,11 @@ ZEND_FUNCTION(gmp_pow)
1142
RETURN_THROWS();
1143
}
1144
1145
- double powmax = log((double)ZEND_LONG_MAX);
1146
-
+ mpz_ptr gmpnum_base;
+ FETCH_GMP_ZVAL(gmpnum_base, base_arg, temp_base, 1);
1147
INIT_GMP_RETVAL(gmpnum_result);
1148
- zend_ulong gmpnum = mpz_get_ui(gmpnum_base);
1149
- if ((log(gmpnum) * exp) > powmax) {
1150
- zend_value_error("base and exponent overflow");
1151
- RETURN_THROWS();
1152
- }
1153
mpz_pow_ui(gmpnum_result, gmpnum_base, exp);
+ FREE_GMP_TEMP(temp_base);
1154
1155
/* }}} */
1156
0 commit comments