cvs: ZendEngine2 / zend_reflection_api.c
| From: | Marcus Boerger | Date: | Sun, 24 Aug 2003 12:07:13 +0000 |
| Subject: | cvs: ZendEngine2 / zend_reflection_api.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-1680@lists.php.net to get a copy of this message | ||
helly Sun Aug 24 08:07:13 2003 EDT
Modified files:
/ZendEngine2 zend_reflection_api.c
Log:
Make invoke() work
Index: ZendEngine2/zend_reflection_api.c
diff -u ZendEngine2/zend_reflection_api.c:1.30 ZendEngine2/zend_reflection_api.c:1.31
--- ZendEngine2/zend_reflection_api.c:1.30 Sun Aug 24 07:34:01 2003
+++ ZendEngine2/zend_reflection_api.c Sun Aug 24 08:07:13 2003
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_reflection_api.c,v 1.30 2003/08/24 11:34:01 helly Exp $ */
+/* $Id: zend_reflection_api.c,v 1.31 2003/08/24 12:07:13 helly Exp $ */
#include "zend.h"
#include "zend_API.h"
#include "zend_default_classes.h"
@@ -739,12 +739,15 @@
{
zval *retval_ptr;
zval ***params;
- zval *fname;
+ zval fname;
int result;
int argc = ZEND_NUM_ARGS();
zend_fcall_info fci;
+ reflection_object *intern;
+ zend_function *fptr;
METHOD_NOTSTATIC;
+ GET_REFLECTION_OBJECT_PTR(fptr);
params = safe_emalloc(sizeof(zval **), argc, 0);
if (zend_get_parameters_array_ex(argc, params) == FAILURE) {
@@ -752,17 +755,11 @@
RETURN_FALSE;
}
- /* Invoke the function.
- *
- * FIXME(?): The creation of fname (NULL) is a workaround since function_name is
- * _always_ checked for in zend_execute_API.c _even_ if a function pointer is given
- */
- MAKE_STD_ZVAL(fname);
- ZVAL_NULL(fname);
+ ZVAL_STRING(&fname, fptr->common.function_name, 0);
fci.size = sizeof(fci);
fci.function_table = EG(function_table);
- fci.function_name = fname;
+ fci.function_name = &fname;
fci.symbol_table = NULL;
fci.object_pp = NULL;
fci.retval_ptr_ptr = &retval_ptr;
@@ -772,7 +769,6 @@
result = zend_call_function(&fci, NULL TSRMLS_CC);
- zval_ptr_dtor(&fname);
efree(params);
if (result == FAILURE) {
@@ -968,7 +964,7 @@
zval **object_pp;
reflection_object *intern;
zend_function *mptr;
- zval *fname;
+ zval fname;
int argc = ZEND_NUM_ARGS();
int result;
zend_fcall_info fci;
@@ -1014,17 +1010,11 @@
object_pp = params[0];
}
- /* Invoke the method.
- *
- * FIXME(?): The creation of fname (NULL) is a workaround since function_name is
- * _always_ checked for in zend_execute_API.c _even_ if a function pointer is given
- */
- MAKE_STD_ZVAL(fname);
- ZVAL_NULL(fname);
+ ZVAL_STRING(&fname, mptr->common.function_name, 0);
fci.size = sizeof(fci);
fci.function_table = EG(function_table);
- fci.function_name = fname;
+ fci.function_name = &fname;
fci.symbol_table = NULL;
fci.object_pp = object_pp;
fci.retval_ptr_ptr = &retval_ptr;
@@ -1035,7 +1025,6 @@
result = zend_call_function(&fci, NULL TSRMLS_CC);
- zval_ptr_dtor(&fname);
efree(params);
if (result == FAILURE) {