From d148ff770f877a1b0cf823eb4c5130c64308d9ea Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Wed, 15 Oct 2003 06:23:07 +0000 Subject: [PATCH] Fix cast function --- Zend/zend_default_classes.c | 6 +++--- Zend/zend_exceptions.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Zend/zend_default_classes.c b/Zend/zend_default_classes.c index 4479921544..4bd6850b8f 100644 --- a/Zend/zend_default_classes.c +++ b/Zend/zend_default_classes.c @@ -358,7 +358,7 @@ static zend_function_entry default_exception_functions[] = { {NULL, NULL, NULL} }; -void zend_cast_exception(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC) +int zend_cast_exception(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC) { if (type == IS_STRING) { zval fname, *retval; @@ -367,10 +367,10 @@ void zend_cast_exception(zval *readobj, zval *writeobj, int type, int should_fre if (call_user_function_ex(NULL, &readobj, &fname, &retval, 0, NULL, 0, NULL TSRMLS_CC) == SUCCESS) { ZVAL_STRING(writeobj, Z_STRVAL_P(retval), 1); zval_ptr_dtor(&retval); - return; + return SUCCESS; } } - Z_TYPE_P(writeobj) = IS_NULL; + return FAILURE; } static void zend_register_default_exception(TSRMLS_D) diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 4479921544..4bd6850b8f 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -358,7 +358,7 @@ static zend_function_entry default_exception_functions[] = { {NULL, NULL, NULL} }; -void zend_cast_exception(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC) +int zend_cast_exception(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC) { if (type == IS_STRING) { zval fname, *retval; @@ -367,10 +367,10 @@ void zend_cast_exception(zval *readobj, zval *writeobj, int type, int should_fre if (call_user_function_ex(NULL, &readobj, &fname, &retval, 0, NULL, 0, NULL TSRMLS_CC) == SUCCESS) { ZVAL_STRING(writeobj, Z_STRVAL_P(retval), 1); zval_ptr_dtor(&retval); - return; + return SUCCESS; } } - Z_TYPE_P(writeobj) = IS_NULL; + return FAILURE; } static void zend_register_default_exception(TSRMLS_D) -- 2.50.1