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

@ -2416,8 +2416,7 @@ static void check_unrecoverable_load_failure(zend_class_entry *ce) {
zend_string *exception_str;
zval exception_zv;
ZEND_ASSERT(EG(exception) && "Exception must have been thrown");
ZVAL_OBJ(&exception_zv, EG(exception));
Z_ADDREF(exception_zv);
ZVAL_OBJ_COPY(&exception_zv, EG(exception));
zend_clear_exception();
exception_str = zval_get_string(&exception_zv);
zend_error_noreturn(E_ERROR,