cvs: ZendEngine2 / zend_operators.c
| From: | Antony Dovgal | Date: | Fri, 13 Jul 2007 17:07:02 +0000 |
| Subject: | cvs: ZendEngine2 / zend_operators.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-5903@lists.php.net to get a copy of this message | ||
tony2001 Fri Jul 13 17:07:02 2007 UTC
Modified files:
/ZendEngine2 zend_operators.c
Log:
("0" == NULL) must be false even in Unicode mode
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_operators.c?r1=1.279&r2=1.280&diff_format=u
Index: ZendEngine2/zend_operators.c
diff -u ZendEngine2/zend_operators.c:1.279 ZendEngine2/zend_operators.c:1.280
--- ZendEngine2/zend_operators.c:1.279 Wed Jul 11 11:19:58 2007
+++ ZendEngine2/zend_operators.c Fri Jul 13 17:07:02 2007
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_operators.c,v 1.279 2007/07/11 11:19:58 tony2001 Exp $ */
+/* $Id: zend_operators.c,v 1.280 2007/07/13 17:07:02 tony2001 Exp $ */
#include <ctype.h>
@@ -1941,6 +1941,21 @@
}
}
+ if ((Z_TYPE_P(op1) == IS_NULL && Z_TYPE_P(op2) == IS_UNICODE)
+ || (Z_TYPE_P(op2) == IS_NULL && Z_TYPE_P(op1) == IS_UNICODE)) {
+ UChar *empty_str = USTR_MAKE("");
+
+ if (Z_TYPE_P(op1) == IS_NULL) {
+ ZVAL_LONG(result, zend_u_binary_strcmp(empty_str, 0, Z_USTRVAL_P(op2), Z_USTRLEN_P(op2)));
+ efree(empty_str);
+ COMPARE_RETURN_AND_FREE(SUCCESS);
+ } else {
+ ZVAL_LONG(result, zend_u_binary_strcmp(Z_USTRVAL_P(op1), Z_USTRLEN_P(op1), empty_str, 0));
+ efree(empty_str);
+ COMPARE_RETURN_AND_FREE(SUCCESS);
+ }
+ }
+
if ((Z_TYPE_P(op1) == IS_UNICODE || Z_TYPE_P(op1) == IS_STRING) &&
(Z_TYPE_P(op2) == IS_UNICODE || Z_TYPE_P(op2) == IS_STRING)) {