cvs: ZendEngine2 / zend_operators.c
[email protected] ("Matt Wilmas") Tue, 17 Feb 2009 14:14:56 -0000
| Newsgroups | php.zend-engine.cvs |
|---|---|
| Message-ID | <cvsmattwil1234880096@cvsserver> |
mattwil Tue Feb 17 14:14:56 2009 UTC
Modified files:
/ZendEngine2 zend_operators.c
Log:
Fixed bug #47422 (modulus operator returns incorrect results on 64 bit linux)
Removed abs(), just -1 needs to be checked (only LONG_MIN % -1 is a problem)
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_operators.c?r1=1.298&r2=1.299&diff_format=u
Index: ZendEngine2/zend_operators.c
diff -u ZendEngine2/zend_operators.c:1.298 ZendEngine2/zend_operators.c:1.299
--- ZendEngine2/zend_operators.c:1.298 Mon Jan 5 19:47:12 2009
+++ ZendEngine2/zend_operators.c Tue Feb 17 14:14:56 2009
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_operators.c,v 1.298 2009/01/05 19:47:12 felipe Exp $ */
+/* $Id: zend_operators.c,v 1.299 2009/02/17 14:14:56 mattwil Exp $ */
#include <ctype.h>
@@ -1523,7 +1523,7 @@
return FAILURE; /* modulus by zero */
}
- if (abs(Z_LVAL_P(op2)) == 1) {
+ if (Z_LVAL_P(op2) == -1) {
ZVAL_LONG(result, 0);
return SUCCESS;
}