Re: com php-src: use ZVAL_ZVAL to init ZVAL from ZVAL: Zend/zend_compile.c
| From: | Ferenc Kovacs | Date: | Mon, 16 Dec 2013 13:55:41 +0000 |
| Subject: | Re: com php-src: use ZVAL_ZVAL to init ZVAL from ZVAL: Zend/zend_compile.c | ||
| References: | 1 2 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-74456@lists.php.net to get a copy of this message | ||
Hi Dmitry,
it was merged from the following PR:
https://github.com/php/php-src/pull/526
(somehow the commitdiff is bogus
since the PR got merged).
AFAIR Igor added that commit after Sara suggested it on github, but maybe I
remember it wrong.
On Tue, Dec 10, 2013 at 12:27 PM, Dmitry Stogov <dmitry@zend.com> wrote:
> What was the reason for this patch?
> Is it just cosmetic?
> Anyway, it introduced memory leaks that I've just fixed.
>
> Thanks. Dmitry.
>
>
> On Sat, Nov 9, 2013 at 10:48 PM, Ferenc Kovacs <tyrael@php.net> wrote:
>
>> Commit: 611da37617749c81ab22b1e44a0cc1f294cc493a
>> Author: Igor Wiedler <igor@wiedler.ch> Sat, 9 Nov 2013
>> 13:48:23 -0500
>> Parents: eb063e007508affcf26eb2b105b596f6a7672a05
>> Branches: PHP-5.6 master
>>
>> Link:
>>
>> http://git.php.net/?p=php-src.git;a=commitdiff;h=611da37617749c81ab22b1e44a0cc1f294cc493a
>>
>> Log:
>> use ZVAL_ZVAL to init ZVAL from ZVAL
>>
>> Changed paths:
>> M Zend/zend_compile.c
>>
>>
>> Diff:
>> diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
>> index 3bee745..44e95ad 100644
>> --- a/Zend/zend_compile.c
>> +++ b/Zend/zend_compile.c
>> @@ -7055,7 +7055,7 @@ void zend_do_use(znode *ns_name, znode *new_name,
>> int is_global TSRMLS_DC) /* {{
>> }
>>
>> ALLOC_ZVAL(ns);
>> - *ns = ns_name->u.constant;
>> + ZVAL_ZVAL(ns, &ns_name->u.constant, 0, 0);
>> if (new_name) {
>> name = &new_name->u.constant;
>> } else {
>> @@ -7068,8 +7068,7 @@ void zend_do_use(znode *ns_name, znode *new_name,
>> int is_global TSRMLS_DC) /* {{
>> if (p) {
>> ZVAL_STRING(name, p+1, 1);
>> } else {
>> - *name = *ns;
>> - zval_copy_ctor(name);
>> + ZVAL_ZVAL(name, ns, 1, 0);
>> warn = !is_global && !CG(current_namespace);
>> }
>> }
>> @@ -7133,7 +7132,7 @@ void zend_do_use_non_class(znode *ns_name, znode
>> *new_name, int is_global, int i
>> zend_bool warn = 0;
>>
>> ALLOC_ZVAL(ns);
>> - *ns = ns_name->u.constant;
>> + ZVAL_ZVAL(ns, &ns_name->u.constant, 0, 0);
>> if (new_name) {
>> name = &new_name->u.constant;
>> } else {
>> @@ -7146,8 +7145,7 @@ void zend_do_use_non_class(znode *ns_name, znode
>> *new_name, int is_global, int i
>> if (p) {
>> ZVAL_STRING(name, p+1, 1);
>> } else {
>> - *name = *ns;
>> - zval_copy_ctor(name);
>> + ZVAL_ZVAL(name, ns, 1, 0);
>> warn = !is_global && !CG(current_namespace);
>> }
>> }
>>
>>
>> --
>> PHP CVS Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>