]> 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:15:52 +0000 (14:15 +0000)
committerMatt Wilmas <mattwil@php.net>
Tue, 17 Feb 2009 14:15:52 +0000 (14:15 +0000)
Zend/zend_operators.c

index 57e4e7f5ab2b44c3474355529cb9b53fe360ccb4..79e1217a0908a16302478f7dd6b54c8a60aa923a 100644 (file)
@@ -1005,7 +1005,7 @@ ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
                return FAILURE;                 /* modulus by zero */
        }
 
-       if (abs(Z_LVAL_P(op2)) == 1) {
+       if (Z_LVAL_P(op2) == -1) {
                ZVAL_LONG(result, 0);
                return SUCCESS;
        }