cvs: php-src /ext/gmp gmp.c
| From: | Ilia Alshanetsky | Date: | Wed, 30 Jan 2008 18:26:08 +0000 |
| Subject: | cvs: php-src /ext/gmp gmp.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-48183@lists.php.net to get a copy of this message | ||
iliaa Wed Jan 30 18:26:08 2008 UTC
Modified files:
/php-src/ext/gmp gmp.c
Log:
MFB: Fixed bug #43981 (gmp_div_r() does not preserve the sign of 1st argument)
http://cvs.php.net/viewvc.cgi/php-src/ext/gmp/gmp.c?r1=1.67&r2=1.68&diff_format=u
Index: php-src/ext/gmp/gmp.c
diff -u php-src/ext/gmp/gmp.c:1.67 php-src/ext/gmp/gmp.c:1.68
--- php-src/ext/gmp/gmp.c:1.67 Mon Dec 31 07:12:10 2007
+++ php-src/ext/gmp/gmp.c Wed Jan 30 18:26:08 2008
@@ -577,6 +577,9 @@
if (use_ui && gmp_ui_op) {
if (allow_ui_return) {
long_result = gmp_ui_op(*gmpnum_result, *gmpnum_a, (unsigned long)Z_LVAL_PP(b_arg));
+ if (mpz_sgn(*gmpnum_a) == -1) {
+ long_result = -long_result;
+ }
} else {
gmp_ui_op(*gmpnum_result, *gmpnum_a, (unsigned long)Z_LVAL_PP(b_arg));
}