summaryrefslogtreecommitdiff
path: root/Zend/zend_execute_API.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-02-18 17:31:27 +0400
committerDmitry Stogov <dmitry@zend.com>2014-02-18 17:31:27 +0400
commit9e6c0c6a89e8b48042283fc42c9dc6f70cc41a44 (patch)
tree564aa20eb869458274519ffd5cfd8d1b5368ab96 /Zend/zend_execute_API.c
parent246d50fd95c23545f8520175b6f8e3614f76b1ec (diff)
downloadphp-git-9e6c0c6a89e8b48042283fc42c9dc6f70cc41a44.tar.gz
Use better data structures (incomplete)
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r--Zend/zend_execute_API.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 509e6b8ed6..21958308a0 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -738,7 +738,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
zend_fcall_info_cache fci_cache_local;
zval tmp;
- fci->retval = NULL;
+ ZVAL_UNDEF(fci->retval);
if (!EG(active)) {
return FAILURE; /* executor is already inactive */
@@ -802,7 +802,11 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
calling_scope = fci_cache->calling_scope;
called_scope = fci_cache->called_scope;
fci->object_ptr = fci_cache->object_ptr;
- ZVAL_COPY_VALUE(&EX(object), fci->object_ptr);
+ if (fci->object_ptr) {
+ ZVAL_COPY_VALUE(&EX(object), fci->object_ptr);
+ } else {
+ ZVAL_UNDEF(&EX(object));
+ }
if (fci->object_ptr && Z_TYPE_P(fci->object_ptr) == IS_OBJECT &&
(!EG(objects_store).object_buckets ||
!IS_VALID(EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(fci->object_ptr)]))) {
@@ -859,12 +863,9 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
(EX(function_state).function->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) == 0 ) {
param = &tmp;
ZVAL_DUP(param, &fci->params[i]);
-//??? } else if (*fci->params[i] != &EG(uninitialized_zval)) {
- Z_ADDREF(fci->params[i]);
- param = &fci->params[i];
-//??? } else {
-//??? param = &tmp;
-//??? ZVAL_COPY_VALUE(param, &fci->params[i]);
+ } else {
+ param = &tmp;
+ ZVAL_COPY(param, &fci->params[i]);
}
zend_vm_stack_push(param TSRMLS_CC);
}