mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
Explicitly create references in UConverter callbacks
And don't allow separation.
This commit is contained in:
parent
5b4bf4d3e9
commit
e93aca7167
1 changed files with 4 additions and 2 deletions
|
@ -224,11 +224,12 @@ static void php_converter_to_u_callback(const void *context,
|
||||||
ZVAL_EMPTY_STRING(&zargs[2]);
|
ZVAL_EMPTY_STRING(&zargs[2]);
|
||||||
}
|
}
|
||||||
ZVAL_LONG(&zargs[3], *pErrorCode);
|
ZVAL_LONG(&zargs[3], *pErrorCode);
|
||||||
|
ZVAL_MAKE_REF(&zargs[3]);
|
||||||
|
|
||||||
objval->to_cb.param_count = 4;
|
objval->to_cb.param_count = 4;
|
||||||
objval->to_cb.params = zargs;
|
objval->to_cb.params = zargs;
|
||||||
objval->to_cb.retval = &retval;
|
objval->to_cb.retval = &retval;
|
||||||
objval->to_cb.no_separation = 0;
|
objval->to_cb.no_separation = 1;
|
||||||
if (zend_call_function(&(objval->to_cb), &(objval->to_cache)) == FAILURE) {
|
if (zend_call_function(&(objval->to_cb), &(objval->to_cache)) == FAILURE) {
|
||||||
/* Unlikely */
|
/* Unlikely */
|
||||||
php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR, "Unexpected failure calling toUCallback()");
|
php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR, "Unexpected failure calling toUCallback()");
|
||||||
|
@ -306,11 +307,12 @@ static void php_converter_from_u_callback(const void *context,
|
||||||
}
|
}
|
||||||
ZVAL_LONG(&zargs[2], codePoint);
|
ZVAL_LONG(&zargs[2], codePoint);
|
||||||
ZVAL_LONG(&zargs[3], *pErrorCode);
|
ZVAL_LONG(&zargs[3], *pErrorCode);
|
||||||
|
ZVAL_MAKE_REF(&zargs[3]);
|
||||||
|
|
||||||
objval->from_cb.param_count = 4;
|
objval->from_cb.param_count = 4;
|
||||||
objval->from_cb.params = zargs;
|
objval->from_cb.params = zargs;
|
||||||
objval->from_cb.retval = &retval;
|
objval->from_cb.retval = &retval;
|
||||||
objval->from_cb.no_separation = 0;
|
objval->from_cb.no_separation = 1;
|
||||||
if (zend_call_function(&(objval->from_cb), &(objval->from_cache)) == FAILURE) {
|
if (zend_call_function(&(objval->from_cb), &(objval->from_cache)) == FAILURE) {
|
||||||
/* Unlikely */
|
/* Unlikely */
|
||||||
php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR, "Unexpected failure calling fromUCallback()");
|
php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR, "Unexpected failure calling fromUCallback()");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue