summaryrefslogtreecommitdiffstats
path: root/php-bug78412.patch
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2019-08-28 09:09:18 +0200
committerRemi Collet <remi@remirepo.net>2019-08-28 09:09:18 +0200
commit58e5eb330af82c1443996b5ac76809e7f69d1565 (patch)
treefebb23f70b973d53308fbac660f4d67c97254d40 /php-bug78412.patch
parent150076429667667589763bc35bc7efd4875e6ec6 (diff)
- Update to 7.2.22 - http://www.php.net/releases/7_2_22.php
- fix generator incorrectly reports non-releasable $this as GC child https://bugs.php.net/78412
Diffstat (limited to 'php-bug78412.patch')
-rw-r--r--php-bug78412.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/php-bug78412.patch b/php-bug78412.patch
new file mode 100644
index 0000000..f4f8b4a
--- /dev/null
+++ b/php-bug78412.patch
@@ -0,0 +1,37 @@
+From fcabe7e5e44067319f9c4123d71a7cea6a823af4 Mon Sep 17 00:00:00 2001
+From: Nikita Popov <nikita.ppv@gmail.com>
+Date: Wed, 14 Aug 2019 17:48:57 +0200
+Subject: [PATCH] Fixed bug #78412
+
+$this should only be included in the generator GC buffer, if it
+will be released on destruction.
+---
+ NEWS | 4 ++++
+ Zend/zend_generators.c | 4 ++--
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+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) {
+--
+2.1.4
+