summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2019-04-09 14:39:15 +0300
committerDmitry Stogov <dmitry@zend.com>2019-04-09 14:39:15 +0300
commit578049f1578adaf000f4524c7b46b1607285f8b2 (patch)
treef203dc459e1e8443f71ceea76cb5dadfe3673796 /Zend
parent9c14cfdc78d3599537ef16ae116053c9c2b1448d (diff)
parent5fdee9394f5481459316c0e46a9ad8e25cab6134 (diff)
downloadphp-git-578049f1578adaf000f4524c7b46b1607285f8b2.tar.gz
Merge branch 'PHP-7.4'
* PHP-7.4: Micro-optimization
Diffstat (limited to 'Zend')
-rw-r--r--Zend/zend_execute.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h
index 59b0742d82..808b0bc5cc 100644
--- a/Zend/zend_execute.h
+++ b/Zend/zend_execute.h
@@ -96,20 +96,19 @@ static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval
if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(variable_ptr)))) {
zend_bool need_copy = ZEND_CONST_COND(value_type & (IS_CONST|IS_CV), 1) ||
((value_type & IS_VAR) && UNEXPECTED(ref) && GC_REFCOUNT(ref) > 1);
+ zend_bool ret;
if (need_copy) {
ZVAL_COPY(&tmp, value);
value = &tmp;
}
- if (!zend_verify_ref_assignable_zval(Z_REF_P(variable_ptr), value, strict)) {
- if (need_copy) {
- Z_TRY_DELREF_P(value);
- }
- zval_ptr_dtor(value);
- return Z_REFVAL_P(variable_ptr);
- }
+ ret = zend_verify_ref_assignable_zval(Z_REF_P(variable_ptr), value, strict);
if (need_copy) {
Z_TRY_DELREF_P(value);
}
+ if (!ret) {
+ zval_ptr_dtor(value);
+ return Z_REFVAL_P(variable_ptr);
+ }
}
variable_ptr = Z_REFVAL_P(variable_ptr);