diff options
author | Marcus Boerger <helly@php.net> | 2003-08-24 12:07:13 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2003-08-24 12:07:13 +0000 |
commit | 669603f69d7133053e5c1b888caa229c7e5b276a (patch) | |
tree | 6fbb300075a415906a6ca0a9cba939dd32dfae01 /ext/reflection/php_reflection.c | |
parent | 96d4ac7a3fc9ea44342af24724a34ca76679e0b0 (diff) | |
download | php-git-669603f69d7133053e5c1b888caa229c7e5b276a.tar.gz |
Make invoke() work
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 5f4683d5dd..8be56841ac 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -739,12 +739,15 @@ ZEND_METHOD(reflection_function, invoke) { 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 @@ ZEND_METHOD(reflection_function, invoke) 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 @@ ZEND_METHOD(reflection_function, invoke) result = zend_call_function(&fci, NULL TSRMLS_CC); - zval_ptr_dtor(&fname); efree(params); if (result == FAILURE) { @@ -968,7 +964,7 @@ ZEND_METHOD(reflection_method, invoke) 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 @@ ZEND_METHOD(reflection_method, invoke) 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 @@ ZEND_METHOD(reflection_method, invoke) result = zend_call_function(&fci, NULL TSRMLS_CC); - zval_ptr_dtor(&fname); efree(params); if (result == FAILURE) { |