summaryrefslogtreecommitdiff
path: root/Zend/zend_operators.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2015-09-02 22:08:24 +0200
committerAnatol Belski <ab@php.net>2015-09-02 22:08:24 +0200
commit6ef7c6358fc37579d329268cbb56ab730bed2159 (patch)
tree2fe3452647d7450c867de9eab62f456ed77a2553 /Zend/zend_operators.c
parentb7e910e9696001ae6fa728c10362f657b4b97742 (diff)
parentfcece2a7bb0ecf1af1034a737bf5686a354e01d7 (diff)
downloadphp-git-6ef7c6358fc37579d329268cbb56ab730bed2159.tar.gz
Merge branch 'master' into PHP-7.0.0
* master: (201 commits) sync NEWS Add missing variable from birdstep_commit() which got removed in e8fcd52ef Align NEWS entries format Add CVE for #70140 (PHP 7.0.0 Beta 3) Seems master is not affected We should keep one refcount to resource Fixed bug #70398 (SIGSEGV, Segmentation fault zend_ast_destroy_ex) Fixed test Partially fix bug #67167 - Wrong return value... move the phpdbg NEWS entry to the correct version add missing news entries Skip if ext/filter isn't loaded Merge branch 'PHP-5.6' 5.5.30 next Use ZSTR_VAL fix dir separators in test use correct api fix leak cleanup an atavism add overflow check ...
Diffstat (limited to 'Zend/zend_operators.c')
-rw-r--r--Zend/zend_operators.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index 77916f25a3..0e2cc91cf6 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -14,6 +14,7 @@
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
+ | Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
@@ -642,10 +643,12 @@ try_again:
switch (Z_TYPE_P(op)) {
case IS_ARRAY:
{
- zval tmp;
- ZVAL_COPY_VALUE(&tmp, op);
- SEPARATE_ARRAY(&tmp);
- object_and_properties_init(op, zend_standard_class_def, Z_ARR(tmp));
+ HashTable *ht = Z_ARR_P(op);
+ if (Z_IMMUTABLE_P(op)) {
+ /* TODO: try not to duplicate immutable arrays as well ??? */
+ ht = zend_array_dup(ht);
+ }
+ object_and_properties_init(op, zend_standard_class_def, ht);
break;
}
case IS_OBJECT: