com php-src: Fix zend_fcall_info_arg*() to use ZVAL_COPY: Zend/zend_API.c main/output.c
| From: | Michael Wallner | Date: | Thu, 04 Dec 2014 12:02:30 +0000 |
| Subject: | com php-src: Fix zend_fcall_info_arg*() to use ZVAL_COPY: Zend/zend_API.c main/output.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-83507@lists.php.net to get a copy of this message | ||
Commit: f0a17c293b5b240a4da27e6b5f89dbd9c9183488
Author: Michael Wallner <mike@php.net> Thu, 4 Dec 2014 13:02:30 +0100
Parents: f8e7b3d166a4aba2ebd9469731b01ccd30065184
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f0a17c293b5b240a4da27e6b5f89dbd9c9183488
Log:
Fix zend_fcall_info_arg*() to use ZVAL_COPY
As zend_fcall_info_args_clear() calls zval_ptr_dtor() we also have
to increase the refcount of refcounted zvals added as params,
like it is already done in zend_fcall_info_args_ex().
Changed paths:
M Zend/zend_API.c
M main/output.c
Diff:
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 10efd7a..369852f 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -3504,7 +3504,7 @@ ZEND_API int zend_fcall_info_argp(zend_fcall_info *fci TSRMLS_DC, int argc,
zval
fci->params = (zval *) erealloc(fci->params, fci->param_count * sizeof(zval));
for (i = 0; i < argc; ++i) {
- ZVAL_COPY_VALUE(&fci->params[i], &argv[i]);
+ ZVAL_COPY(&fci->params[i], &argv[i]);
}
}
@@ -3529,7 +3529,7 @@ ZEND_API int zend_fcall_info_argv(zend_fcall_info *fci TSRMLS_DC, int argc,
va_l
for (i = 0; i < argc; ++i) {
arg = va_arg(*argv, zval *);
- ZVAL_COPY_VALUE(&fci->params[i], arg);
+ ZVAL_COPY(&fci->params[i], arg);
}
}
diff --git a/main/output.c b/main/output.c
index a1530b6..c8b41ba 100644
--- a/main/output.c
+++ b/main/output..c
@@ -961,6 +961,7 @@ static inline php_output_handler_status_t php_output_handler_op(php_output_handl
ZVAL_STRINGL(&ob_data, handler->buffer.data, handler->buffer.used);
ZVAL_LONG(&ob_mode, (zend_long) context->op);
zend_fcall_info_argn(&handler->func.user->fci TSRMLS_CC, 2, &ob_data,
&ob_mode);
+ zval_ptr_dtor(&ob_data);
#define PHP_OUTPUT_USER_SUCCESS(retval) ((Z_TYPE(retval) != IS_UNDEF) && !(Z_TYPE(retval)
== IS_FALSE))
if (SUCCESS == zend_fcall_info_call(&handler->func.user->fci,
&handler->func.user->fcc, &retval, NULL TSRMLS_CC) &&
PHP_OUTPUT_USER_SUCCESS(retval)) {