For Programmers: Free Programming Magazines  


Home > Archive > PHP Zend Engine > November 2004 > cvs: ZendEngine2 / zend_reflection_api.c









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author cvs: ZendEngine2 / zend_reflection_api.c
Marcus Boerger

2004-11-03, 8:55 pm

helly Wed Nov 3 16:11:49 2004 EDT

Modified files:
/ZendEngine2 zend_reflection_api.c
Log:
- Fix invokeargs() with static methods

http://cvs.php.net/diff.php/ZendEng...6&r2=1.137&ty=u
Index: ZendEngine2/zend_reflection_api.c
diff -u ZendEngine2/zend_reflection_api.c:1.136 ZendEngine2/zend_reflection_api.c:1.137
--- ZendEngine2/zend_reflection_api.c:1.136 Sun Oct 31 10:30:53 2004
+++ ZendEngine2/zend_reflection_api.c Wed Nov 3 16:11:48 2004
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/

-/* $Id: zend_reflection_api.c,v 1.136 2004/10/31 15:30:53 helly Exp $ */
+/* $Id: zend_reflection_api.c,v 1.137 2004/11/03 21:11:48 helly Exp $ */
#include "zend.h"
#include "zend_API.h"
#include "zend_exceptions.h"
@@ -2029,7 +2029,7 @@

GET_REFLECTION_OBJECT_PTR(mptr);

- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "oa", &object, ¶m_array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o!a", &object, ¶m_array) == FAILURE) {
return;
}

@@ -2065,6 +2065,14 @@
object = NULL;
obj_ce = NULL;
} else {
+ if (!object) {
+ efree(params);
+ zend_throw_exception_ex(reflection_e
xception_ptr, 0 TSRMLS_CC,
+ "Trying to invoke non static method %s::%s without an object",
+ mptr->common.scope->name, mptr->common.function_name);
+ return;
+ }
+
obj_ce = Z_OBJCE_P(object);

if (!instanceof_function(obj_ce, mptr->common.scope TSRMLS_CC)) {
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com