com php-src: Fixed ASSIGN of IS_REFERENCE (it should be separated): Zend/zend_execute.c
| From: | Dmitry Stogov | Date: | Thu, 27 Feb 2014 18:16:15 +0000 |
| Subject: | com php-src: Fixed ASSIGN of IS_REFERENCE (it should be separated): Zend/zend_execute.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77858@lists.php.net to get a copy of this message | ||
Commit: 0e44e0611d85a06b68f5c578b22ed47aa49fbbee
Author: Dmitry Stogov <dmitry@zend.com> Thu, 27 Feb 2014 22:16:15 +0400
Parents: c5a508582f6d4bbdb812298ca79c23a90af2ab7c
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0e44e0611d85a06b68f5c578b22ed47aa49fbbee
Log:
Fixed ASSIGN of IS_REFERENCE (it should be separated)
Changed paths:
M Zend/zend_execute.c
Diff:
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index ca2761e..567d2f7 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -950,14 +950,22 @@ static inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value
TSRM
zval garbage;
if (EXPECTED(!IS_REFCOUNTED(Z_TYPE_P(variable_ptr)))) {
- ZVAL_COPY(variable_ptr, value);
+ if (EXPECTED(!Z_ISREF_P(value))) {
+ ZVAL_COPY(variable_ptr, value);
+ } else {
+ ZVAL_DUP(variable_ptr, Z_REFVAL_P(value));
+ }
return variable_ptr;
} else if (Z_ISREF_P(variable_ptr)) {
variable_ptr = Z_REFVAL_P(variable_ptr);
}
if (EXPECTED(!IS_REFCOUNTED(Z_TYPE_P(variable_ptr)))) {
- ZVAL_COPY(variable_ptr, value);
+ if (EXPECTED(!Z_ISREF_P(value))) {
+ ZVAL_COPY(variable_ptr, value);
+ } else {
+ ZVAL_DUP(variable_ptr, Z_REFVAL_P(value));
+ }
} else if (Z_TYPE_P(variable_ptr) == IS_OBJECT &&
UNEXPECTED(Z_OBJ_HANDLER_P(variable_ptr, set) != NULL)) {
Z_OBJ_HANDLER_P(variable_ptr, set)(variable_ptr, value TSRMLS_CC);
@@ -975,16 +983,20 @@ static inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value
TSRM
//??? ZVAL_COPY(variable_ptr, value);
//??? } else {
ZVAL_COPY_VALUE(&garbage, variable_ptr);
- ZVAL_DUP(variable_ptr, value);
+ if (EXPECTED(!Z_ISREF_P(value))) {
+ ZVAL_DUP(variable_ptr, value);
+ } else {
+ ZVAL_DUP(variable_ptr, Z_REFVAL_P(value));
+ }
_zval_dtor_func(&garbage ZEND_FILE_LINE_CC);
//??? }
} else { /* we need to split */
Z_DELREF_P(variable_ptr);
GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr);
- if (Z_ISREF_P(value)) {
- ZVAL_DUP(variable_ptr, Z_REFVAL_P(value));
- } else {
+ if (EXPECTED(!Z_ISREF_P(value))) {
ZVAL_COPY(variable_ptr, value);
+ } else {
+ ZVAL_DUP(variable_ptr, Z_REFVAL_P(value));
}
}
//??? } else {