cvs: ZendEngine2 / zend_execute_API.c zend_reflection_api.c
| From: | Marcus Boerger | Date: | Sun, 13 Feb 2005 23:04:50 +0000 |
| Subject: | cvs: ZendEngine2 / zend_execute_API.c zend_reflection_api.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-3389@lists.php.net to get a copy of this message | ||
helly Sun Feb 13 18:04:50 2005 EDT
Modified files:
/ZendEngine2 zend_reflection_api.c zend_execute_API.c
Log:
- Be more gracious in reflection API
http://cvs.php.net/diff.php/ZendEngine2/zend_reflection_api.c?r1=1.146&r2=1.147&ty=u
Index: ZendEngine2/zend_reflection_api.c
diff -u ZendEngine2/zend_reflection_api.c:1.146 ZendEngine2/zend_reflection_api.c:1.147
--- ZendEngine2/zend_reflection_api.c:1.146 Mon Jan 31 17:56:01 2005
+++ ZendEngine2/zend_reflection_api.c Sun Feb 13 18:04:48 2005
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_reflection_api.c,v 1.146 2005/01/31 22:56:01 helly Exp $ */
+/* $Id: zend_reflection_api.c,v 1.147 2005/02/13 23:04:48 helly Exp $ */
#include "zend.h"
#include "zend_API.h"
#include "zend_exceptions.h"
@@ -1027,15 +1027,19 @@
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 @@
} 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;
}
http://cvs.php.net/diff.php/ZendEngine2/zend_execute_API.c?r1=1.310&r2=1.311&ty=u
Index: ZendEngine2/zend_execute_API.c
diff -u ZendEngine2/zend_execute_API.c:1.310 ZendEngine2/zend_execute_API.c:1.311
--- ZendEngine2/zend_execute_API.c:1.310 Sat Feb 12 11:38:47 2005
+++ ZendEngine2/zend_execute_API.c Sun Feb 13 18:04:49 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_execute_API.c,v 1.310 2005/02/12 16:38:47 helly Exp $ */
+/* $Id: zend_execute_API.c,v 1.311 2005/02/13 23:04:49 helly Exp $ */
#include <stdio.h>
#include <signal.h>
@@ -952,15 +952,15 @@
return FAILURE;
}
- if (EG(exception)) {
+ if (EG(exception) && exception) {
free_alloca(lc_name);
zend_error(E_ERROR, "Function %s(%s) threw an exception of type '%s'",
ZEND_AUTOLOAD_FUNC_NAME, name, Z_OBJCE_P(EG(exception))->name);
return FAILURE;
}
- EG(exception) = exception;
-
- /* If an exception is thrown retval_ptr will be NULL but we bailout before we reach this point */
- zval_ptr_dtor(&retval_ptr);
+ if (!EG(exception)) {
+ EG(exception) = exception;
+ zval_ptr_dtor(&retval_ptr);
+ }
retval = zend_hash_find(EG(class_table), lc_name, name_length + 1, (void **) ce);
free_alloca(lc_name);