From: Dmitry Stogov Date: Tue, 28 May 2019 17:19:15 +0000 (+0300) Subject: Merge branch 'PHP-7.4' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b2cdde08269c837a6c085dbc5d102c4b318b6150;p=php Merge branch 'PHP-7.4' * PHP-7.4: Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macros --- b2cdde08269c837a6c085dbc5d102c4b318b6150 diff --cc ext/xml/xml.c index c109be343f,f60f08bd57..23cbcb5772 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@@ -1240,10 -1188,20 +1240,11 @@@ PHP_FUNCTION(xml_set_object return; } - if ((parser = (xml_parser *)zend_fetch_resource(Z_RES_P(pind), "XML Parser", le_xml_parser)) == NULL) { - RETURN_FALSE; - } - - /* please leave this commented - or ask thies@thieso.net before doing it (again) */ - if (!Z_ISUNDEF(parser->object)) { - zval_ptr_dtor(&parser->object); - } - - /* please leave this commented - or ask thies@thieso.net before doing it (again) */ - /* zval_add_ref(&parser->object); */ + parser = Z_XMLPARSER_P(pind); + zval_ptr_dtor(&parser->object); - ZVAL_COPY(&parser->object, mythis); + Z_ADDREF_P(mythis); + ZVAL_OBJ(&parser->object, Z_OBJ_P(mythis)); RETVAL_TRUE; }