cvs: ZendEngine2 / zend_reflection_api.c
| From: | Marcus Boerger | Date: | Wed, 27 Aug 2003 20:45:34 +0000 |
| Subject: | cvs: ZendEngine2 / zend_reflection_api.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-1709@lists.php.net to get a copy of this message | ||
helly Wed Aug 27 16:45:34 2003 EDT
Modified files:
/ZendEngine2 zend_reflection_api.c
Log:
Fix reflection_class::newInstance()
Index: ZendEngine2/zend_reflection_api.c
diff -u ZendEngine2/zend_reflection_api.c:1.33 ZendEngine2/zend_reflection_api.c:1.34
--- ZendEngine2/zend_reflection_api.c:1.33 Sun Aug 24 12:35:58 2003
+++ ZendEngine2/zend_reflection_api.c Wed Aug 27 16:45:34 2003
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_reflection_api.c,v 1.33 2003/08/24 16:35:58 helly Exp $ */
+/* $Id: zend_reflection_api.c,v 1.34 2003/08/27 20:45:34 helly Exp $ */
#include "zend.h"
#include "zend_API.h"
#include "zend_default_classes.h"
@@ -1585,6 +1585,7 @@
zval ***params;
zval *fname;
zend_fcall_info fci;
+ zend_fcall_info_cache fcc;
params = safe_emalloc(sizeof(zval **), argc, 0);
if (zend_get_parameters_array_ex(argc, params) == FAILURE) {
@@ -1592,35 +1593,30 @@
RETURN_FALSE;
}
- /* Invoke the constructor
- *
- * 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);
-
fci.size = sizeof(fci);
fci.function_table = EG(function_table);
- fci.function_name = fname;
+ fci.function_name = NULL;
fci.symbol_table = NULL;
fci.object_pp = &return_value;
fci.retval_ptr_ptr = &retval_ptr;
fci.param_count = argc;
fci.params = params;
fci.no_separation = 1;
- /*fci.function_handler_cache = &ce->constructor;*/
+
+ fcc.initialized = 1;
+ fcc.function_handler = ce->constructor;
+ fcc.calling_scope = EG(scope);
+ fcc.object_pp = &return_value;
- if (zend_call_function(&fci, NULL TSRMLS_CC) == FAILURE) {
+ if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
efree(params);
- zval_ptr_dtor(&fname);
+ zval_ptr_dtor(&retval_ptr);
zend_error(E_WARNING, "Invokation of %s's constructor failed\n", ce->name);
RETURN_NULL();
}
if (retval_ptr) {
zval_ptr_dtor(&retval_ptr);
}
- zval_ptr_dtor(&fname);
efree(params);
}
}