]> granicus.if.org Git - php/commitdiff
Fix cast function
authorMarcus Boerger <helly@php.net>
Wed, 15 Oct 2003 06:23:07 +0000 (06:23 +0000)
committerMarcus Boerger <helly@php.net>
Wed, 15 Oct 2003 06:23:07 +0000 (06:23 +0000)
Zend/zend_default_classes.c
Zend/zend_exceptions.c

index 447992154416b5575e9076bc55d29d93072c4411..4bd6850b8f5930a1ffb7c9443bb9193c5bc45045 100644 (file)
@@ -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)
index 447992154416b5575e9076bc55d29d93072c4411..4bd6850b8f5930a1ffb7c9443bb9193c5bc45045 100644 (file)
@@ -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)