diff options
author | Xinchen Hui <laruence@php.net> | 2014-07-06 17:48:16 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2014-07-06 17:48:16 +0800 |
commit | d759ead04fa78745fb2d0fc49e90046988b5e291 (patch) | |
tree | 33c15e3955d8cfc2a0eae6ac41c32d6e73370914 /ext/intl/converter | |
parent | 439a95908bb95148c943d340dd6b538f6261ef9e (diff) | |
download | php-git-d759ead04fa78745fb2d0fc49e90046988b5e291.tar.gz |
Fixed convert (ext/intl finished)
Diffstat (limited to 'ext/intl/converter')
-rw-r--r-- | ext/intl/converter/converter.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c index 930fe9509a..16dbf8c55e 100644 --- a/ext/intl/converter/converter.c +++ b/ext/intl/converter/converter.c @@ -63,6 +63,7 @@ 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, long reason, zval *error TSRMLS_DC) { + ZVAL_DEREF(error); zval_dtor(error); ZVAL_LONG(error, U_ZERO_ERROR); /* Basic functionality so children can call parent::toUCallback() */ @@ -251,6 +252,8 @@ static void php_converter_to_u_callback(const void *context, if (Z_TYPE(zargs[3]) == IS_LONG) { *pErrorCode = Z_LVAL(zargs[3]); + } else if (Z_ISREF(zargs[3]) && Z_TYPE_P(Z_REFVAL(zargs[3])) == IS_LONG) { + *pErrorCode = Z_LVAL_P(Z_REFVAL(zargs[3])); } zval_ptr_dtor(&zargs[0]); @@ -334,6 +337,8 @@ static void php_converter_from_u_callback(const void *context, if (Z_TYPE(zargs[3]) == IS_LONG) { *pErrorCode = Z_LVAL(zargs[3]); + } else if (Z_ISREF(zargs[3]) && Z_TYPE_P(Z_REFVAL(zargs[3])) == IS_LONG) { + *pErrorCode = Z_LVAL_P(Z_REFVAL(zargs[3])); } zval_ptr_dtor(&zargs[0]); @@ -1107,7 +1112,7 @@ int php_converter_minit(INIT_FUNC_ARGS) { memcpy(&php_converter_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); php_converter_object_handlers.offset = XtOffsetOf(php_converter_object, obj); php_converter_object_handlers.clone_obj = php_converter_clone_object; - php_converter_object_handlers.free_obj = php_converter_free_object; + php_converter_object_handlers.dtor_obj = php_converter_free_object; /* enum UConverterCallbackReason */ CONV_REASON_CONST(UNASSIGNED); |