Re: Re: com php-src: Fixed incorrect ZEND_ACC_ARENA_ALLOCATED usage (it must be used only for internal functions).: Zend/zend_inheritance.c
| From: | Dmitry Stogov | Date: | Mon, 03 Sep 2018 07:23:47 +0000 |
| Subject: | Re: Re: com php-src: Fixed incorrect ZEND_ACC_ARENA_ALLOCATED usage (it must be used only for internal functions).: Zend/zend_inheritance.c | ||
| References: | 1 2 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-102966@lists.php.net to get a copy of this message | ||
Thanks for catching. It's fixed now.
Dmitry.
________________________________
From: Christoph M. Becker <cmbecker69@gmx.de>
Sent: Saturday, September 1, 2018 4:13:45 PM
To: Dmitry Stogov; php-cvs@lists.php.net
Subject: [PHP-CVS] Re: com php-src: Fixed incorrect ZEND_ACC_ARENA_ALLOCATED usage (it must be used
only for internal functions).: Zend/zend_inheritance.c
On 29.08.2018 at 22:40, Dmitry Stogov wrote:
> Commit: 709e4e4f17ddbeb99b366c293c3e2eaa16480a7a
> Author: Dmitry Stogov <dmitry@zend.com> Wed, 29 Aug 2018 23:40:17 +0300
> Parents: 5fee4e71088a9827e4ca2d27975941be3b07d695
> Branches: PHP-7.1 PHP-7.2 PHP-7.3 master
>
> Link:
> http://git.php.net/?p=php-src.git;a=commitdiff;h=709e4e4f17ddbeb99b366c293c3e2eaa16480a7a
>
> Log:
> Fixed incorrect ZEND_ACC_ARENA_ALLOCATED usage (it must be used only for internal functions).
>
> Changed paths:
> M Zend/zend_inheritance.c
>
>
> Diff:
> diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c
> index 16c8f9d..b0c1f0a 100644
> --- a/Zend/zend_inheritance.c
> +++ b/Zend/zend_inheritance.c
> @@ -1224,10 +1224,15 @@ static void zend_add_trait_method(zend_class_entry *ce, const char
> *name, zend_s
> }
> }
>
> - function_add_ref(fn);
> - new_fn = zend_arena_alloc(&CG(arena), sizeof(zend_op_array));
> - memcpy(new_fn, fn, sizeof(zend_op_array));
> - new_fn->common.fn_flags |= ZEND_ACC_ARENA_ALLOCATED;
> + if (UNEXPECTED(fn->type == ZEND_INTERNAL_FUNCTION)) {
> + new_fn = zend_arena_alloc(&CG(arena), sizeof(zend_internal_function));
> + memcpy(new_fn, fn, sizeof(zend_internal_function));
> + new_fn->common.fn_flags |= ZEND_ACC_ARENA_ALLOCATED;
> + } else {
> + function_add_ref(fn);
> + new_fn = zend_arena_alloc(&CG(arena), sizeof(zend_op_array));
> + memcpy(new_fn, fn, sizeof(zend_op_array));
> + }
> fn = zend_hash_update_ptr(&ce->function_table, key, new_fn);
> zend_add_magic_methods(ce, key, fn);
> }
It seems that this commit causes Zend/tests/traits/bug69579.phpt to
always raise SIGABRT for PHP-7.1 on Travis (Debug + ZTS)[1]. I cannot
reproduce this locally (test runs fine). Higher branches are apparently
not affected. Could you please have a look?
[1] <https://travis-ci.org/php/php-src/branches>
--
Christoph M. Becker
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php