cvs: php-src /ext/gmp gmp.c

From: Date: Sun, 15 Feb 2004 17:22:57 +0000
Subject: cvs: php-src /ext/gmp gmp.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-26206@lists.php.net to get a copy of this message
iliaa Sun Feb 15 12:22:57 2004 EDT Modified files: /php-src/ext/gmp gmp.c Log: Fixed bug #27258 (moved FPE check to correct location). Fixed several possible FPE. http://cvs.php.net/diff.php/php-src/ext/gmp/gmp.c?r1=1.43&r2=1.44&ty=u Index: php-src/ext/gmp/gmp.c diff -u php-src/ext/gmp/gmp.c:1.43 php-src/ext/gmp/gmp.c:1.44 --- php-src/ext/gmp/gmp.c:1.43 Sun Feb 8 23:27:35 2004 +++ php-src/ext/gmp/gmp.c Sun Feb 15 12:22:57 2004 @@ -312,6 +312,11 @@ FETCH_GMP_ZVAL(gmpnum_b, b_arg); } + convert_to_long_ex(b_arg); + if (!Z_LVAL_PP(b_arg)) { + RETURN_FALSE; + } + INIT_GMP_NUM(gmpnum_result); if (use_ui && gmp_ui_op) { @@ -353,6 +358,11 @@ FETCH_GMP_ZVAL(gmpnum_b, b_arg); } + convert_to_long_ex(b_arg); + if (!Z_LVAL_PP(b_arg)) { + RETURN_FALSE; + } + INIT_GMP_NUM(gmpnum_result1); INIT_GMP_NUM(gmpnum_result2); @@ -825,11 +835,6 @@ WRONG_PARAM_COUNT; } - convert_to_long_ex(mod_arg); - if (!Z_LVAL_PP(mod_arg)) { - RETURN_FALSE; - } - FETCH_GMP_ZVAL(gmpnum_base, base_arg); if (Z_TYPE_PP(exp_arg) == IS_LONG && Z_LVAL_PP(exp_arg) >= 0) { @@ -839,6 +844,11 @@ } FETCH_GMP_ZVAL(gmpnum_mod, mod_arg); + convert_to_long_ex(mod_arg); + if (!Z_LVAL_PP(mod_arg)) { + RETURN_FALSE; + } + INIT_GMP_NUM(gmpnum_result); if (use_ui) { mpz_powm_ui(*gmpnum_result, *gmpnum_base, (unsigned long)Z_LVAL_PP(exp_arg), *gmpnum_mod);

« previous php.cvs (#26206) next »