Skip to content

Commit 6d19acf

Browse files
committed
Use type-checked ref assignment in UConverter
1 parent cb88184 commit 6d19acf

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

ext/intl/converter/converter.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ static inline void php_converter_throw_failure(php_converter_object *objval, UEr
6363

6464
/* {{{ php_converter_default_callback */
6565
static void php_converter_default_callback(zval *return_value, zval *zobj, zend_long reason, zval *error) {
66-
ZVAL_DEREF(error);
67-
zval_ptr_dtor(error);
68-
ZVAL_LONG(error, U_ZERO_ERROR);
6966
/* Basic functionality so children can call parent::toUCallback() */
7067
switch (reason) {
7168
case UCNV_UNASSIGNED:
@@ -81,7 +78,7 @@ static void php_converter_default_callback(zval *return_value, zval *zobj, zend_
8178
chars[0] = 0x1A;
8279
chars[1] = 0;
8380
chars_len = 1;
84-
ZVAL_LONG(error, U_INVALID_STATE_ERROR);
81+
ZEND_TRY_ASSIGN_REF_LONG(error, U_INVALID_STATE_ERROR);
8582
RETVAL_STRINGL(chars, chars_len);
8683
return;
8784
}
@@ -99,8 +96,8 @@ static void php_converter_default_callback(zval *return_value, zval *zobj, zend_
9996
chars[0] = 0x1A;
10097
chars[1] = 0;
10198
chars_len = 1;
102-
ZVAL_LONG(error, uerror);
10399
}
100+
ZEND_TRY_ASSIGN_REF_LONG(error, uerror);
104101
RETVAL_STRINGL(chars, chars_len);
105102
}
106103
}

0 commit comments

Comments
 (0)