Skip to content

Commit

Permalink
Merge branch 'PHP-8.2' into PHP-8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Nov 27, 2024
2 parents 3c3ec0e + 5fd53a8 commit 841e54d
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 127 deletions.
13 changes: 0 additions & 13 deletions ext/gmp/gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1354,26 +1354,13 @@ ZEND_FUNCTION(gmp_pow)
RETURN_THROWS();
}

double powmax = log((double)ZEND_LONG_MAX);

if (Z_TYPE_P(base_arg) == IS_LONG && Z_LVAL_P(base_arg) >= 0) {
INIT_GMP_RETVAL(gmpnum_result);
if ((log(Z_LVAL_P(base_arg)) * exp) > powmax) {
zend_value_error("base and exponent overflow");
RETURN_THROWS();
}
mpz_ui_pow_ui(gmpnum_result, Z_LVAL_P(base_arg), exp);
} else {
mpz_ptr gmpnum_base;
zend_ulong gmpnum;
FETCH_GMP_ZVAL(gmpnum_base, base_arg, temp_base, 1);
INIT_GMP_RETVAL(gmpnum_result);
gmpnum = mpz_get_ui(gmpnum_base);
if ((log(gmpnum) * exp) > powmax) {
FREE_GMP_TEMP(temp_base);
zend_value_error("base and exponent overflow");
RETURN_THROWS();
}
mpz_pow_ui(gmpnum_result, gmpnum_base, exp);
FREE_GMP_TEMP(temp_base);
}
Expand Down
2 changes: 0 additions & 2 deletions ext/gmp/tests/gmp_pow.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
gmp_pow() basic tests
--EXTENSIONS--
gmp
--SKIPIF--
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
--FILE--
<?php

Expand Down
77 changes: 0 additions & 77 deletions ext/gmp/tests/gmp_pow_32bits.phpt

This file was deleted.

35 changes: 0 additions & 35 deletions ext/gmp/tests/gmp_pow_fpe.phpt

This file was deleted.

0 comments on commit 841e54d

Please sign in to comment.