| Marcus Boerger 2005-03-02, 3:56 am |
| helly Tue Mar 1 18:42:29 2005 EDT
Modified files: (Branch: PHP_5_0)
/ZendEngine2 zend_interfaces.c
Log:
- MFH
http://cvs.php.net/diff.php/ZendEng...2=1.21.2.4&ty=u
Index: ZendEngine2/zend_interfaces.c
diff -u ZendEngine2/zend_interfaces.c:1.21.2.3 ZendEngine2/zend_interfaces.c:1.21.2.4
--- ZendEngine2/zend_interfaces.c:1.21.2.3 Tue Jan 25 05:44:28 2005
+++ ZendEngine2/zend_interfaces.c Tue Mar 1 18:42:29 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_interfaces.c,v 1.21.2.3 2005/01/25 10:44:28 helly Exp $ */
+/* $Id: zend_interfaces.c,v 1.21.2.4 2005/03/01 23:42:29 helly Exp $ */
#include "zend.h"
#include "zend_API.h"
@@ -36,6 +36,7 @@
zend_fcall_info fci;
zval z_fname;
zval *retval;
+ HashTable *function_table;
zval **params[2];
@@ -62,12 +63,17 @@
fcic.initialized = 1;
if (!obj_ce) {
- obj_ce = Z_OBJCE_PP(object_pp);
+ obj_ce = object_pp ? Z_OBJCE_PP(object_pp) : NULL;
+ }
+ if (obj_ce) {
+ function_table = &obj_ce->function_table;
+ } else {
+ function_table = EG(function_table);
}
if (!fn_proxy || !*fn_proxy) {
- if (zend_hash_find(&obj_ce->function_table, function_name, function_name_len+1, (void **) &fcic.function_handler) == FAILURE) {
+ if (zend_hash_find(function_table, function_name, function_name_len+1, (void **) &fcic.function_handler) == FAILURE) {
/* error at c-level */
- zend_error(E_CORE_ERROR, "Couldn't find implementation for method %s::%s", obj_ce->name, function_name);
+ zend_error(E_CORE_ERROR, "Couldn't find implementation for method %s%s%s", obj_ce ? obj_ce->name : "", obj_ce ? "::" : "", function_name);
}
if (fn_proxy) {
*fn_proxy = fcic.function_handler;
@@ -82,9 +88,9 @@
if (result == FAILURE) {
/* error at c-level */
if (!obj_ce) {
- obj_ce = Z_OBJCE_PP(object_pp);
+ obj_ce = object_pp ? Z_OBJCE_PP(object_pp) : NULL;
}
- zend_error(E_CORE_ERROR, "Couldn't execute method %s::%s", obj_ce->name, function_name);
+ zend_error(E_CORE_ERROR, "Couldn't execute method %s%s%s", obj_ce ? obj_ce->name : "", obj_ce ? "::" : "", function_name);
}
if (!retval_ptr_ptr) {
if (retval) {
|