diff options
author | Xinchen Hui <laruence@gmail.com> | 2018-08-17 13:35:15 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2018-08-17 13:35:15 +0800 |
commit | 04c4854fdfbc11b2b6a2cf1c8045f2efcd5dcdcc (patch) | |
tree | f6ebd9dd787dd51bb5e0f6560fe12250420a6bb3 | |
parent | 64c88c1e168cb4489e5adae4067e35f7abd18046 (diff) | |
download | php-git-04c4854fdfbc11b2b6a2cf1c8045f2efcd5dcdcc.tar.gz |
Fixed bug #76754 (parent private constant in extends class memory leak)
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | Zend/tests/bug76754.phpt | 18 | ||||
-rw-r--r-- | Zend/zend_opcode.c | 2 |
3 files changed, 21 insertions, 1 deletions
@@ -3,6 +3,8 @@ PHP NEWS ?? ??? ????, PHP 7.1.22 - Core: + . Fixed bug #76754 (parent private constant in extends class memory leak). + (Laruence) . Fixed bug #72443 (Generate enabled extension). (petk) - Bz2: 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 fe1d95737a..8168f6a047 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -296,8 +296,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); } |