summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
Diffstat (limited to 'Zend')
-rw-r--r--Zend/zend_API.c7
-rw-r--r--Zend/zend_execute_API.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index c0f7d533b1..a9c10b6c32 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -3344,6 +3344,11 @@ ZEND_API int zend_fcall_info_init(zval *callable, uint check_flags, zend_fcall_i
ZEND_API void zend_fcall_info_args_clear(zend_fcall_info *fci, int free_mem) /* {{{ */
{
if (fci->params) {
+ int i;
+
+ for (i = 0; i < fci->param_count; i++) {
+ zval_ptr_dtor(&fci->params[i]);
+ }
if (free_mem) {
efree(fci->params);
fci->params = NULL;
@@ -3390,7 +3395,7 @@ ZEND_API int zend_fcall_info_args(zend_fcall_info *fci, zval *args TSRMLS_DC) /*
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(args), &pos);
while ((arg = zend_hash_get_current_data_ex(Z_ARRVAL_P(args), &pos)) != NULL) {
- ZVAL_COPY_VALUE(params, arg);
+ ZVAL_COPY(params, arg);
params++;
zend_hash_move_forward_ex(Z_ARRVAL_P(args), &pos);
}
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 8faba97fc7..ea02c0f160 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -856,7 +856,12 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
return FAILURE;
}
- zval_copy_ctor(&fci->params[i]);
+ if (Z_REFCOUNTED(fci->params[i])) {
+ Z_DELREF(fci->params[i]);
+ }
+ ZVAL_DUP(&tmp, &fci->params[i]);
+ ZVAL_NEW_REF(&fci->params[i], &tmp);
+ Z_ADDREF(fci->params[i]);
} else if (!Z_ISREF(fci->params[i])) {
if (Z_REFCOUNTED(fci->params[i])) {
Z_ADDREF(fci->params[i]);