com php-src: Fix ArrayObject with immutable array: ext/spl/spl _array.c

From: Date: Thu, 29 May 2014 19:19:49 +0000
Subject: com php-src: Fix ArrayObject with immutable array: ext/spl/spl _array.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-78638@lists.php.net to get a copy of this message
Commit: 9c85aa0489671e6cec43406161c558567e5b7336 Author: Nikita Popov <nikic@php.net> Thu, 29 May 2014 21:19:49 +0200 Parents: b3b616cf7ee0702aca2f6fdb022dc7e28e015a22 Branches: phpng Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9c85aa0489671e6cec43406161c558567e5b7336 Log: Fix ArrayObject with immutable array Changed paths: M ext/spl/spl_array.c Diff: diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 2fa7a53..9420990 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -1146,6 +1146,9 @@ static void spl_array_set_array(zval *object, spl_array_object *intern, zval *ar if (Z_TYPE_P(array) == IS_ARRAY) { SEPARATE_ZVAL_IF_NOT_REF(array); } + if (Z_IMMUTABLE_P(array)) { + zval_copy_ctor(array); + } if (Z_TYPE_P(array) == IS_OBJECT && (Z_OBJ_HT_P(array) == &spl_handler_ArrayObject || Z_OBJ_HT_P(array) == &spl_handler_ArrayIterator)) { zval_ptr_dtor(&intern->array);

« previous php.cvs (#78638) next »