com php-src: Avoid useless duplication of immutable arrays: Zend/zend_execute.c
| From: | Dmitry Stogov | Date: | Fri, 30 May 2014 07:12:24 +0000 |
| Subject: | com php-src: Avoid useless duplication of immutable arrays: Zend/zend_execute.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-78647@lists.php.net to get a copy of this message | ||
Commit: 984c8f87d2ca3840c3d3551713e1eff15aedd712
Author: Dmitry Stogov <dmitry@zend.com> Fri, 30 May 2014 11:12:24 +0400
Parents: 45d7ab1a4c323c50bc5007cf826540e62693db8c
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=984c8f87d2ca3840c3d3551713e1eff15aedd712
Log:
Avoid useless duplication of immutable arrays
Changed paths:
M Zend/zend_execute.c
Diff:
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 37539d6..0cfd8f4 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -729,8 +729,10 @@ static inline void zend_assign_to_object(zval *retval, zval *object_ptr, zval
*p
ZVAL_COPY_VALUE(&tmp, value);
value = &tmp;
} else if (value_type == IS_CONST) {
- ZVAL_DUP(&tmp, value);
- value = &tmp;
+ if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
+ ZVAL_DUP(&tmp, value);
+ value = &tmp;
+ }
} else if (Z_REFCOUNTED_P(value)) {
Z_ADDREF_P(value);
}