@@ -1352,37 +1352,12 @@ ZEND_FUNCTION(gmp_pow)
1352
1352
1353
1353
if (Z_TYPE_P (base_arg ) == IS_LONG && Z_LVAL_P (base_arg ) >= 0 ) {
1354
1354
INIT_GMP_RETVAL (gmpnum_result );
1355
- if (exp >= INT_MAX ) {
1356
- mpz_t base_num , exp_num , mod ;
1357
- mpz_init (base_num );
1358
- mpz_init (exp_num );
1359
- mpz_init (mod );
1360
- mpz_set_si (base_num , Z_LVAL_P (base_arg ));
1361
- mpz_set_si (exp_num , exp );
1362
- mpz_set_ui (mod , UINT_MAX );
1363
- mpz_powm (gmpnum_result , base_num , exp_num , mod );
1364
- mpz_clear (mod );
1365
- mpz_clear (exp_num );
1366
- mpz_clear (base_num );
1367
- } else {
1368
- mpz_ui_pow_ui (gmpnum_result , Z_LVAL_P (base_arg ), exp );
1369
- }
1355
+ mpz_ui_pow_ui (gmpnum_result , Z_LVAL_P (base_arg ), exp );
1370
1356
} else {
1371
1357
mpz_ptr gmpnum_base ;
1372
1358
FETCH_GMP_ZVAL (gmpnum_base , base_arg , temp_base , 1 );
1373
1359
INIT_GMP_RETVAL (gmpnum_result );
1374
- if (exp >= INT_MAX ) {
1375
- mpz_t exp_num , mod ;
1376
- mpz_init (exp_num );
1377
- mpz_init (mod );
1378
- mpz_set_si (exp_num , exp );
1379
- mpz_set_ui (mod , UINT_MAX );
1380
- mpz_powm (gmpnum_result , gmpnum_base , exp_num , mod );
1381
- mpz_clear (mod );
1382
- mpz_clear (exp_num );
1383
- } else {
1384
- mpz_pow_ui (gmpnum_result , gmpnum_base , exp );
1385
- }
1360
+ mpz_pow_ui (gmpnum_result , gmpnum_base , exp );
1386
1361
FREE_GMP_TEMP (temp_base );
1387
1362
}
1388
1363
}
0 commit comments