summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2018-08-17 13:36:03 +0800
committerXinchen Hui <laruence@gmail.com>2018-08-17 13:36:03 +0800
commit3131ebcea8bd17f9695e49ea56dc2bc85e785fa8 (patch)
tree5c8439cd42a1d18b8e9d2e6c3f5a96c952198859
parentfd463a9a6078074f8f648982b42bdd14423fb614 (diff)
parentacd4264f7b9169038cd3f320169c1ec569c3e5ba (diff)
downloadphp-git-3131ebcea8bd17f9695e49ea56dc2bc85e785fa8.tar.gz
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2: Update NEWS Fixed bug #76754 (parent private constant in extends class memory leak)
-rw-r--r--Zend/tests/bug76754.phpt18
-rw-r--r--Zend/zend_opcode.c2
2 files changed, 19 insertions, 1 deletions
diff --git a/Zend/tests/bug76754.phpt b/Zend/tests/bug76754.phpt
new file mode 100644
index 0000000000..424f1fbffc
--- /dev/null
+++ b/Zend/tests/bug76754.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Bug #76754 (parent private constant in extends class memory leak)
+--INI--
+opcache.enable=0
+opcache.enable_cli=0
+--FILE--
+<?php
+
+class FOO
+{
+ private const FOO = 'BAR';
+}
+
+class BAR extends FOO { }
+?>
+okey
+--EXPECT--
+okey
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index f750403620..6bed3c7b59 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -256,8 +256,8 @@ ZEND_API void destroy_zend_class(zval *zv)
}
}
} ZEND_HASH_FOREACH_END();
- zend_hash_destroy(&ce->constants_table);
}
+ zend_hash_destroy(&ce->constants_table);
if (ce->num_interfaces > 0 && ce->interfaces) {
efree(ce->interfaces);
}