com php-src: Revert code to use DUP instead of COPY: Zend/zend_ini_parser.y ext/reflection/php_reflection .c ext/standard/basic_functions.c
| From: | Nikita Popov | Date: | Fri, 29 Apr 2016 20:02:31 +0000 |
| Subject: | com php-src: Revert code to use DUP instead of COPY: Zend/zend_ini_parser.y ext/reflection/php_reflection .c ext/standard/basic_functions.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91974@lists.php.net to get a copy of this message | ||
Commit: 5595dd5ffa3453f22c0508052417d3b2853f5015
Author: Nikita Popov <nikic@php.net> Fri, 29 Apr 2016 22:00:54 +0200
Parents: 2c5704bdc228bd13a1152aedeeadb831dd782fd3
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5595dd5ffa3453f22c0508052417d3b2853f5015
Log:
Revert code to use DUP instead of COPY
In a1c405e0c50c627cdd9a7695b4c7d644238b6b9b next to the actual fix
I have also switched some (effective) ZVAL_DUPs to ZVAL_COPYs. I'm
reverting this part as those were probably there for a reason
(presumably issues with non-atomic refcounting on ZTS).
Changed paths:
M Zend/zend_ini_parser.y
M ext/reflection/php_reflection.c
M ext/standard/basic_functions.c
Diff:
diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y
index ed047c0..1078259 100644
--- a/Zend/zend_ini_parser..y
+++ b/Zend/zend_ini_parser.y
@@ -132,7 +132,7 @@ static void zend_ini_get_constant(zval *result, zval *name)
if (!memchr(Z_STRVAL_P(name), ':', Z_STRLEN_P(name))
&& (c = zend_get_constant(Z_STR_P(name))) != 0) {
if (Z_TYPE_P(c) != IS_STRING) {
- ZVAL_COPY(&tmp, c);
+ ZVAL_DUP(&tmp, c);
if (Z_OPT_CONSTANT(tmp)) {
zval_update_constant_ex(&tmp, NULL);
}
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index d618627..5b8569e 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -2884,7 +2884,7 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
return;
}
- ZVAL_COPY(return_value, RT_CONSTANT(¶m->fptr->op_array, precv->op2));
+ ZVAL_DUP(return_value, RT_CONSTANT(¶m->fptr->op_array, precv->op2));
if (Z_CONSTANT_P(return_value)) {
zval_update_constant_ex(return_value, param->fptr->common.scope);
}
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index dcd0b0f..f887903 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -3843,7 +3843,7 @@ PHP_FUNCTION(constant)
scope = zend_get_executed_scope();
c = zend_get_constant_ex(const_name, scope, ZEND_FETCH_CLASS_SILENT);
if (c) {
- ZVAL_COPY(return_value, c);
+ ZVAL_DUP(return_value, c);
if (Z_CONSTANT_P(return_value)) {
if (UNEXPECTED(zval_update_constant_ex(return_value, scope) != SUCCESS)) {
return;