@@ -1366,37 +1366,12 @@ ZEND_FUNCTION(gmp_pow)
13661366
13671367 if (Z_TYPE_P (base_arg ) == IS_LONG && Z_LVAL_P (base_arg ) >= 0 ) {
13681368 INIT_GMP_RETVAL (gmpnum_result );
1369- if (exp >= INT_MAX ) {
1370- mpz_t base_num , exp_num , mod ;
1371- mpz_init (base_num );
1372- mpz_init (exp_num );
1373- mpz_init (mod );
1374- mpz_set_si (base_num , Z_LVAL_P (base_arg ));
1375- mpz_set_si (exp_num , exp );
1376- mpz_set_ui (mod , UINT_MAX );
1377- mpz_powm (gmpnum_result , base_num , exp_num , mod );
1378- mpz_clear (mod );
1379- mpz_clear (exp_num );
1380- mpz_clear (base_num );
1381- } else {
1382- mpz_ui_pow_ui (gmpnum_result , Z_LVAL_P (base_arg ), exp );
1383- }
1369+ mpz_ui_pow_ui (gmpnum_result , Z_LVAL_P (base_arg ), exp );
13841370 } else {
13851371 mpz_ptr gmpnum_base ;
13861372 FETCH_GMP_ZVAL (gmpnum_base , base_arg , temp_base , 1 );
13871373 INIT_GMP_RETVAL (gmpnum_result );
1388- if (exp >= INT_MAX ) {
1389- mpz_t exp_num , mod ;
1390- mpz_init (exp_num );
1391- mpz_init (mod );
1392- mpz_set_si (exp_num , exp );
1393- mpz_set_ui (mod , UINT_MAX );
1394- mpz_powm (gmpnum_result , gmpnum_base , exp_num , mod );
1395- mpz_clear (mod );
1396- mpz_clear (exp_num );
1397- } else {
1398- mpz_pow_ui (gmpnum_result , gmpnum_base , exp );
1399- }
1374+ mpz_pow_ui (gmpnum_result , gmpnum_base , exp );
14001375 FREE_GMP_TEMP (temp_base );
14011376 }
14021377}
0 commit comments