]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #47422 (modulus operator returns incorrect results on 64 bit linux)
authorMatt Wilmas <mattwil@php.net>
Tue, 17 Feb 2009 14:16:36 +0000 (14:16 +0000)
committerMatt Wilmas <mattwil@php.net>
Tue, 17 Feb 2009 14:16:36 +0000 (14:16 +0000)
Zend/zend_operators.c

index 0d3e846fdf83cb2f22430511504846f61fb3cf3c..849aa34ac4fb6624d9eeab787106bf63566e4d2f 100644 (file)
@@ -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;
        }