diff options
author | Marcus Boerger <helly@php.net> | 2005-02-13 23:04:49 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2005-02-13 23:04:49 +0000 |
commit | a57b6bad69208f9bbbebd6977d75a911f925b1ac (patch) | |
tree | 196da75545455bd0d4ed823d7e8e966c88caf7f9 /Zend/zend_reflection_api.c | |
parent | a92ae61cb8324aae67994269ccad4961b3dd9d04 (diff) | |
download | php-git-a57b6bad69208f9bbbebd6977d75a911f925b1ac.tar.gz |
- Be more gracious in reflection API
Diffstat (limited to 'Zend/zend_reflection_api.c')
-rw-r--r-- | Zend/zend_reflection_api.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/Zend/zend_reflection_api.c b/Zend/zend_reflection_api.c index 75ef5917a3..395c7a754c 100644 --- a/Zend/zend_reflection_api.c +++ b/Zend/zend_reflection_api.c @@ -1027,15 +1027,19 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c result = zend_call_function(&fci, &fcc TSRMLS_CC); + if (retval_ptr) { + zval_ptr_dtor(&retval_ptr); + } + RETURN_ON_EXCEPTION - if (result == FAILURE) { + if (EG(exception)) { zval_dtor(&reflector); - _DO_THROW("Could not create reflector"); + return; } - - if (retval_ptr) { - zval_ptr_dtor(&retval_ptr); + if (result == FAILURE || EG(exception)) { + zval_dtor(&reflector); + _DO_THROW("Could not create reflector"); } /* Call static reflection::export */ @@ -2263,7 +2267,9 @@ static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_ob } else { convert_to_string_ex(&argument); if (zend_lookup_class(Z_STRVAL_P(argument), Z_STRLEN_P(argument), &ce TSRMLS_CC) == FAILURE) { - zend_throw_exception_ex(reflection_exception_ptr, -1 TSRMLS_CC, "Class %s does not exist", Z_STRVAL_P(argument)); + if (!EG(exception)) { + zend_throw_exception_ex(reflection_exception_ptr, -1 TSRMLS_CC, "Class %s does not exist", Z_STRVAL_P(argument)); + } return; } |