com php-src: Fixed assignment reference to itself: Zend/zend_ execute.c
| From: | Dmitry Stogov | Date: | Wed, 19 Mar 2014 18:43:06 +0000 |
| Subject: | com php-src: Fixed assignment reference to itself: Zend/zend_ execute.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77603@lists.php.net to get a copy of this message | ||
Commit: e884d5d8e34a4349c2a3243832cf3379deed3cae
Author: Dmitry Stogov <dmitry@zend.com> Wed, 19 Mar 2014 22:43:06 +0400
Parents: cb411f024d94b92487b06db3ecbcaea3b7c07fff
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e884d5d8e34a4349c2a3243832cf3379deed3cae
Log:
Fixed assignment reference to itself
Changed paths:
M Zend/zend_execute.c
Diff:
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 12c7625..25ac339 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -957,7 +957,7 @@ static inline zval* zend_assign_const_to_variable(zval *variable_ptr, zval *valu
static inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value TSRMLS_DC)
{
zend_refcounted *garbage;
- int is_ref = 0;
+ zval *is_ref = NULL;
if (EXPECTED(!Z_REFCOUNTED_P(variable_ptr))) {
if (EXPECTED(!Z_ISREF_P(value))) {
@@ -967,8 +967,8 @@ static inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value TSRM
}
return variable_ptr;
} else if (Z_ISREF_P(variable_ptr)) {
+ is_ref = variable_ptr;
variable_ptr = Z_REFVAL_P(variable_ptr);
- is_ref = 1;
}
if (EXPECTED(!Z_REFCOUNTED_P(variable_ptr))) {
@@ -985,6 +985,8 @@ static inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value TSRM
} else {
ZVAL_DUP(variable_ptr, value);
}
+ } else if (is_ref == value) {
+ return variable_ptr;
} else {
if (Z_REFCOUNT_P(value) == 1) {
//??? auto dereferencing
@@ -1005,7 +1007,7 @@ assign_simple:
} else {
ZVAL_DUP(variable_ptr, value);
}
- } else {
+ } else if (is_ref != value) {
assign_ref:
if (Z_REFCOUNT_P(value) == 1) {
//??? auto dereferencing