com php-src: Fixed bug #78412: NEWS Zend/zend_generators.c

From: Date: Wed, 14 Aug 2019 15:50:58 +0000
Subject: com php-src: Fixed bug #78412: NEWS Zend/zend_generators.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-107922@lists.php.net to get a copy of this message
Commit: fcabe7e5e44067319f9c4123d71a7cea6a823af4 Author: Nikita Popov <nikita.ppv@gmail.com> Wed, 14 Aug 2019 17:48:57 +0200 Parents: 4b64d47c99c8f7e874b441bcaafadd7b6279eb0e Branches: PHP-7.2 PHP-7.3 PHP-7.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fcabe7e5e44067319f9c4123d71a7cea6a823af4 Log: Fixed bug #78412 $this should only be included in the generator GC buffer, if it will be released on destruction. Bugs: https://bugs.php.net/78412 Changed paths: M NEWS M Zend/zend_generators.c Diff: diff --git a/NEWS b/NEWS index 723be17..8ad6410 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2019, PHP 7.2.23 +- Core: + . Fixed bug #78412 (Generator incorrectly reports non-releasable $this as GC + child). (Nikita) + 29 Aug 2019, PHP 7.2.22 - Core: diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index 666a12f..042ddbc 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -271,7 +271,7 @@ static uint32_t calc_gc_buffer_size(zend_generator *generator) /* {{{ */ if (EX_CALL_INFO() & ZEND_CALL_FREE_EXTRA_ARGS) { size += EX_NUM_ARGS() - op_array->num_args; } - size += Z_TYPE(execute_data->This) == IS_OBJECT; /* $this */ + size += (EX_CALL_INFO() & ZEND_CALL_RELEASE_THIS) != 0; /* $this */ size += (EX_CALL_INFO() & ZEND_CALL_CLOSURE) != 0; /* Closure object */ /* Live vars */ @@ -352,7 +352,7 @@ static HashTable *zend_generator_get_gc(zval *object, zval **table, int *n) /* { } } - if (Z_TYPE(execute_data->This) == IS_OBJECT) { + if (EX_CALL_INFO() & ZEND_CALL_RELEASE_THIS) { ZVAL_OBJ(gc_buffer++, Z_OBJ(execute_data->This)); } if (EX_CALL_INFO() & ZEND_CALL_CLOSURE) {

« previous php.cvs (#107922) next »