diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2021-03-16 11:18:12 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-03-16 11:18:12 +0100 |
commit | 77ebf81492e8d9dcd441894cea9e6efdc8d1011a (patch) | |
tree | 2f9c9054e208950238fdb542771551492c93b7d8 /Zend/Optimizer/zend_inference.c | |
parent | 53e9c36cd94fae193a4fcbb879b93db31a4906c3 (diff) | |
parent | 82622d7583300afb077e819c4a84ef5218bb6e0e (diff) | |
download | php-git-77ebf81492e8d9dcd441894cea9e6efdc8d1011a.tar.gz |
Merge branch 'PHP-8.0'
* PHP-8.0:
Fix refcount inference for typed properties
Diffstat (limited to 'Zend/Optimizer/zend_inference.c')
-rw-r--r-- | Zend/Optimizer/zend_inference.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Zend/Optimizer/zend_inference.c b/Zend/Optimizer/zend_inference.c index a61a18176c..e600139229 100644 --- a/Zend/Optimizer/zend_inference.c +++ b/Zend/Optimizer/zend_inference.c @@ -2316,10 +2316,6 @@ static uint32_t zend_fetch_prop_type(const zend_script *script, zend_property_in } if (prop_info && ZEND_TYPE_IS_SET(prop_info->type)) { uint32_t type = zend_convert_type_declaration_mask(ZEND_TYPE_PURE_MASK(prop_info->type)); - - if (type & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) { - type |= MAY_BE_RC1 | MAY_BE_RCN; - } if (ZEND_TYPE_HAS_CLASS(prop_info->type)) { type |= MAY_BE_OBJECT; if (pce) { @@ -2332,6 +2328,9 @@ static uint32_t zend_fetch_prop_type(const zend_script *script, zend_property_in } } } + if (type & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) { + type |= MAY_BE_RC1 | MAY_BE_RCN; + } return type; } return MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_RC1 | MAY_BE_RCN; |