Re: com php-src: Fix ArrayObject with immutable array: ext/spl/spl_array.c
| From: | Dmitry Stogov | Date: | Thu, 29 May 2014 19:42:54 +0000 |
| Subject: | Re: com php-src: Fix ArrayObject with immutable array: ext/spl/spl_array.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-78639@lists.php.net to get a copy of this message | ||
Hi Nikita,
Please, don't make fast fixed for this problem.
It might need a single general fix instead of fixes in thousands places.
Can you provide a PHPT for the your fix? (email it) I'll need to analyze
what did I miss.
Thanks. Dmitry.
On Thu, May 29, 2014 at 11:19 PM, Nikita Popov <nikic@php.net> wrote:
> 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);
>
>
> --
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>