mirror of
https://github.com/php/php-src.git
synced 2024-09-22 18:37:25 +00:00
Merge branch 'PHP-7.4'
* PHP-7.4: Micro-optimization
This commit is contained in:
commit
578049f157
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user