summaryrefslogtreecommitdiff
path: root/Zend/zend_opcode.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-08-23 17:01:49 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-08-23 17:01:49 +0200
commit51ea7fc4775bad00f332c0c8b0c54be7c60ab2ed (patch)
tree2b2674384fbc5bd7b5011cf5695546c6700788a3 /Zend/zend_opcode.c
parent51905cd2126d8f1523de01a4b5cbdb4f161758c0 (diff)
parent8807889ac280503d5cd1cd05804a6f278a40300e (diff)
downloadphp-git-51ea7fc4775bad00f332c0c8b0c54be7c60ab2ed.tar.gz
Merge branch 'PHP-7.4'
Diffstat (limited to 'Zend/zend_opcode.c')
-rw-r--r--Zend/zend_opcode.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index 6e58181707..1c4f812af3 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -104,7 +104,7 @@ ZEND_API void destroy_zend_function(zend_function *function)
void zend_free_internal_arg_info(zend_internal_function *function) {
if ((function->fn_flags & (ZEND_ACC_HAS_RETURN_TYPE|ZEND_ACC_HAS_TYPE_HINTS)) &&
- !function->scope && function->arg_info) {
+ function->arg_info) {
uint32_t i;
uint32_t num_args = function->num_args + 1;
@@ -135,7 +135,10 @@ ZEND_API void zend_function_dtor(zval *zv)
ZEND_ASSERT(function->common.function_name);
zend_string_release_ex(function->common.function_name, 1);
- zend_free_internal_arg_info(&function->internal_function);
+ /* For methods this will be called explicitly. */
+ if (!function->common.scope) {
+ zend_free_internal_arg_info(&function->internal_function);
+ }
if (!(function->common.fn_flags & ZEND_ACC_ARENA_ALLOCATED)) {
pefree(function, 1);
@@ -352,8 +355,7 @@ ZEND_API void destroy_zend_class(zval *zv)
ZEND_HASH_FOREACH_PTR(&ce->function_table, fn) {
if ((fn->common.fn_flags & (ZEND_ACC_HAS_RETURN_TYPE|ZEND_ACC_HAS_TYPE_HINTS)) &&
fn->common.scope == ce) {
- /* reset function scope to allow arg_info removing */
- fn->common.scope = NULL;
+ zend_free_internal_arg_info(&fn->internal_function);
}
} ZEND_HASH_FOREACH_END();