From 6d19acf54b1553f1f1e9156b85c22a53b10a9c8e Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 28 Feb 2020 10:21:50 +0100 Subject: [PATCH] Use type-checked ref assignment in UConverter --- ext/intl/converter/converter.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c index 8c9377ecae..49d0d25ecf 100644 --- a/ext/intl/converter/converter.c +++ b/ext/intl/converter/converter.c @@ -63,9 +63,6 @@ static inline void php_converter_throw_failure(php_converter_object *objval, UEr /* {{{ php_converter_default_callback */ static void php_converter_default_callback(zval *return_value, zval *zobj, zend_long reason, zval *error) { - ZVAL_DEREF(error); - zval_ptr_dtor(error); - ZVAL_LONG(error, U_ZERO_ERROR); /* Basic functionality so children can call parent::toUCallback() */ switch (reason) { case UCNV_UNASSIGNED: @@ -81,7 +78,7 @@ static void php_converter_default_callback(zval *return_value, zval *zobj, zend_ chars[0] = 0x1A; chars[1] = 0; chars_len = 1; - ZVAL_LONG(error, U_INVALID_STATE_ERROR); + ZEND_TRY_ASSIGN_REF_LONG(error, U_INVALID_STATE_ERROR); RETVAL_STRINGL(chars, chars_len); return; } @@ -99,8 +96,8 @@ static void php_converter_default_callback(zval *return_value, zval *zobj, zend_ chars[0] = 0x1A; chars[1] = 0; chars_len = 1; - ZVAL_LONG(error, uerror); } + ZEND_TRY_ASSIGN_REF_LONG(error, uerror); RETVAL_STRINGL(chars, chars_len); } } -- 2.40.0