@@ -1741,36 +1741,42 @@ ZEND_COLD static zend_result ZEND_FASTCALL get_deprecation_suffix_from_attribute
1741
1741
return SUCCESS ;
1742
1742
}
1743
1743
1744
+ zend_result result = FAILURE ;
1745
+
1744
1746
zend_string * message = zend_empty_string ;
1745
1747
zend_string * since = zend_empty_string ;
1746
1748
1747
1749
zval obj ;
1748
1750
ZVAL_UNDEF (& obj );
1749
- zval * z = NULL ;
1750
- zend_string * property ;
1751
+ zval * z ;
1752
+ zend_string * property = zend_empty_string ;
1753
+
1754
+ /* Construct the Deprecated object to correctly handle parameter processing. */
1751
1755
if (FAILURE == zend_get_attribute_object (& obj , zend_ce_deprecated , deprecated , scope , NULL )) {
1752
- return FAILURE ;
1756
+ goto out ;
1753
1757
}
1754
1758
1759
+ /* Extract the $message property. */
1760
+ zend_string_release (property );
1755
1761
property = ZSTR_KNOWN (ZEND_STR_MESSAGE );
1756
1762
if ((z = zend_read_property_ex (zend_ce_deprecated , Z_OBJ_P (& obj ), property , false, NULL )) == NULL ) {
1757
- goto fail ;
1763
+ goto out ;
1758
1764
}
1759
- zend_string_release (property );
1760
1765
if (Z_TYPE_P (z ) == IS_STRING ) {
1761
1766
message = zend_string_copy (Z_STR_P (z ));
1762
1767
}
1763
1768
1769
+ /* Extract the $since property. */
1770
+ zend_string_release (property );
1764
1771
property = ZSTR_INIT_LITERAL ("since" , 0 );
1765
1772
if ((z = zend_read_property_ex (zend_ce_deprecated , Z_OBJ_P (& obj ), property , false, NULL )) == NULL ) {
1766
- goto fail ;
1773
+ goto out ;
1767
1774
}
1768
- zend_string_release (property );
1769
-
1770
1775
if (Z_TYPE_P (z ) == IS_STRING ) {
1771
1776
since = zend_string_copy (Z_STR_P (z ));
1772
1777
}
1773
1778
1779
+ /* Construct the suffix. */
1774
1780
* message_suffix = zend_strpprintf_unchecked (
1775
1781
0 ,
1776
1782
"%s%S%s%S" ,
@@ -1780,20 +1786,16 @@ ZEND_COLD static zend_result ZEND_FASTCALL get_deprecation_suffix_from_attribute
1780
1786
message
1781
1787
);
1782
1788
1783
- zend_string_release (since );
1784
- zend_string_release (message );
1785
- zval_ptr_dtor (& obj );
1789
+ result = SUCCESS ;
1786
1790
1787
- return SUCCESS ;
1791
+ out :
1788
1792
1789
- fail :
1790
1793
zend_string_release (since );
1791
1794
zend_string_release (message );
1792
1795
zval_ptr_dtor (& obj );
1793
- zval_ptr_dtor (z );
1794
1796
zend_string_release (property );
1795
1797
1796
- return FAILURE ;
1798
+ return result ;
1797
1799
}
1798
1800
1799
1801
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_deprecated_function (const zend_function * fbc )
0 commit comments