cvs: ZendEngine2 / zend_reflection_api.c
| From: | Marcus Boerger | Date: | Sat, 31 Jan 2004 12:20:20 +0000 |
| Subject: | cvs: ZendEngine2 / zend_reflection_api.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-2297@lists.php.net to get a copy of this message | ||
helly Sat Jan 31 07:20:20 2004 EDT
Modified files:
/ZendEngine2 zend_reflection_api.c
Log:
Throw an exception in case a reflection object cannot be found and do not
override the exception from constructors in static method calls.
http://cvs.php.net/diff.php/ZendEngine2/zend_reflection_api.c?r1=1.82&r2=1.83&ty=u
Index: ZendEngine2/zend_reflection_api.c
diff -u ZendEngine2/zend_reflection_api.c:1.82 ZendEngine2/zend_reflection_api.c:1.83
--- ZendEngine2/zend_reflection_api.c:1.82 Sun Jan 18 05:45:36 2004
+++ ZendEngine2/zend_reflection_api.c Sat Jan 31 07:20:20 2004
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_reflection_api.c,v 1.82 2004/01/18 10:45:36 helly Exp $ */
+/* $Id: zend_reflection_api.c,v 1.83 2004/01/31 12:20:20 helly Exp $ */
#include "zend.h"
#include "zend_API.h"
#include "zend_default_classes.h"
@@ -51,18 +51,24 @@
ZEND_WRONG_PARAM_COUNT();
\
}
\
+/* Exception throwing macro */
+#define _DO_THROW(msg)
\
+ zend_throw_exception(reflection_exception_ptr, msg, 0 TSRMLS_CC);
\
+ return;
\
+
+#define RETURN_ON_EXCEPTION
\
+ if (EG(exception) && Z_OBJCE_P(EG(exception)) == reflection_exception_ptr) {
\
+ return;
\
+ }
+
#define GET_REFLECTION_OBJECT_PTR(target)
\
intern = (reflection_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
\
if (intern == NULL || intern->ptr == NULL) {
\
+ RETURN_ON_EXCEPTION
\
zend_error(E_ERROR, "Internal error: Failed to retrieve the reflection object");
\
}
\
target = intern->ptr;
\
-/* Exception throwing macro */
-#define _DO_THROW(msg)
\
- zend_throw_exception(reflection_exception_ptr, msg, 0 TSRMLS_CC);
\
- return;
\
-
/* {{{ Smart string functions */
typedef struct _string {
char *string;
@@ -838,6 +844,8 @@
fcc.object_pp = &reflector_ptr;
result = zend_call_function(&fci, &fcc TSRMLS_CC);
+
+ RETURN_ON_EXCEPTION
if (result == FAILURE) {
zval_dtor(&reflector);
@@ -2314,7 +2322,7 @@
if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
efree(params);
zval_ptr_dtor(&retval_ptr);
- zend_error(E_WARNING, "Invokation of %s's constructor failed\n", ce->name);
+ zend_error(E_WARNING, "Invokation of %s's constructor failed", ce->name);
RETURN_NULL();
}
if (retval_ptr) {