com php-src: Fixed reference handling: Zend/zend_operators. c

From: Date: Thu, 14 Aug 2014 11:07:39 +0000
Subject: com php-src: Fixed reference handling: Zend/zend_operators. c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-79859@lists.php.net to get a copy of this message
Commit: e430948581ed849c74bc87504a99a2c8a97b8c1d Author: Dmitry Stogov <dmitry@zend.com> Thu, 14 Aug 2014 15:07:39 +0400 Parents: 2ece977c80da2fd1395fcf3f00314111ac587254 Branches: phpng Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e430948581ed849c74bc87504a99a2c8a97b8c1d Log: Fixed reference handling Changed paths: M Zend/zend_operators.c Diff: diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 403eb7c..09c567d 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -1783,6 +1783,14 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* { return SUCCESS; default: + if (Z_ISREF_P(op1)) { + op1 = Z_REFVAL_P(op1); + continue; + } else if (Z_ISREF_P(op2)) { + op2 = Z_REFVAL_P(op2); + continue; + } + if (Z_TYPE_P(op1) == IS_OBJECT && Z_OBJ_HANDLER_P(op1, compare)) { return Z_OBJ_HANDLER_P(op1, compare)(result, op1, op2 TSRMLS_CC); } else if (Z_TYPE_P(op2) == IS_OBJECT && Z_OBJ_HANDLER_P(op2, compare)) { @@ -1841,11 +1849,7 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* { return SUCCESS; } } - if (Z_ISREF_P(op1)) { - op1 = Z_REFVAL_P(op1); - } else if (Z_ISREF_P(op2)) { - op2 = Z_REFVAL_P(op2); - } else if (!converted) { + if (!converted) { if (Z_TYPE_P(op1) == IS_NULL || Z_TYPE_P(op1) == IS_FALSE) { zendi_convert_to_boolean(op2, op2_copy, result); ZVAL_LONG(result, (Z_TYPE_P(op2) == IS_TRUE) ? -1 : 0);

« previous php.cvs (#79859) next »