Add ZVAL_OBJ_COPY macro

For the common ZVAL_OBJ + GC_ADDREF pattern.
This mirrors the existing ZVAL_STR_COPY API.
This commit is contained in:
Nikita Popov 2020-06-17 12:34:04 +02:00
parent b516566b84
commit 15846ff115
27 changed files with 89 additions and 140 deletions

View file

@ -1085,8 +1085,7 @@ PHP_FUNCTION(xml_set_object)
parser = Z_XMLPARSER_P(pind);
zval_ptr_dtor(&parser->object);
Z_ADDREF_P(mythis);
ZVAL_OBJ(&parser->object, Z_OBJ_P(mythis));
ZVAL_OBJ_COPY(&parser->object, Z_OBJ_P(mythis));
RETVAL_TRUE;
}