Skip to content

Commit c5e8c25

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Use type-checked ref assignment in UConverter
2 parents 5d62f95 + 6d19acf commit c5e8c25

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
@@ -61,9 +61,6 @@ static inline void php_converter_throw_failure(php_converter_object *objval, UEr
6161

6262
/* {{{ php_converter_default_callback */
6363
static void php_converter_default_callback(zval *return_value, zval *zobj, zend_long reason, zval *error) {
64-
ZVAL_DEREF(error);
65-
zval_ptr_dtor(error);
66-
ZVAL_LONG(error, U_ZERO_ERROR);
6764
/* Basic functionality so children can call parent::toUCallback() */
6865
switch (reason) {
6966
case UCNV_UNASSIGNED:
@@ -79,7 +76,7 @@ static void php_converter_default_callback(zval *return_value, zval *zobj, zend_
7976
chars[0] = 0x1A;
8077
chars[1] = 0;
8178
chars_len = 1;
82-
ZVAL_LONG(error, U_INVALID_STATE_ERROR);
79+
ZEND_TRY_ASSIGN_REF_LONG(error, U_INVALID_STATE_ERROR);
8380
RETVAL_STRINGL(chars, chars_len);
8481
return;
8582
}
@@ -97,8 +94,8 @@ static void php_converter_default_callback(zval *return_value, zval *zobj, zend_
9794
chars[0] = 0x1A;
9895
chars[1] = 0;
9996
chars_len = 1;
100-
ZVAL_LONG(error, uerror);
10197
}
98+
ZEND_TRY_ASSIGN_REF_LONG(error, uerror);
10299
RETVAL_STRINGL(chars, chars_len);
103100
}
104101
}

0 commit comments

Comments
 (0)