From: Nikita Popov Date: Fri, 8 Feb 2019 11:20:31 +0000 (+0100) Subject: Fix refcounting of prop types coming from traits X-Git-Tag: php-7.4.0alpha1~1117 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a6fa7f6247d13d4d464a948451866b554721f81;p=php Fix refcounting of prop types coming from traits --- diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index acf09629d0..6a66846145 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -1825,6 +1825,9 @@ static void zend_do_traits_property_binding(zend_class_entry *ce, zend_class_ent Z_TRY_ADDREF_P(prop_value); doc_comment = property_info->doc_comment ? zend_string_copy(property_info->doc_comment) : NULL; + if (ZEND_TYPE_IS_NAME(property_info->type)) { + zend_string_addref(ZEND_TYPE_NAME(property_info->type)); + } zend_declare_typed_property(ce, prop_name, prop_value, flags, doc_comment, property_info->type); zend_string_release_ex(prop_name, 0); } ZEND_HASH_FOREACH_END();