From: Matt Wilmas Date: Tue, 17 Feb 2009 14:16:36 +0000 (+0000) Subject: MFH: Fixed bug #47422 (modulus operator returns incorrect results on 64 bit linux) X-Git-Tag: php-5.2.9RC3~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d4da18bddc1eb02e5840fc334df3e9bd9a7a731;p=php MFH: Fixed bug #47422 (modulus operator returns incorrect results on 64 bit linux) --- diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 0d3e846fdf..849aa34ac4 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -936,7 +936,7 @@ ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) return FAILURE; /* modulus by zero */ } - if (abs(op2->value.lval) == 1) { + if (op2->value.lval == -1) { ZVAL_LONG(result, 0); return SUCCESS; }