summaryrefslogtreecommitdiff
path: root/Zend/zend_inheritance.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-10-01 12:58:26 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-10-01 13:04:06 +0200
commitf2e88512451ba0d48252eaf206a0f242a8cd3ddb (patch)
tree403c8468ecccced83538e7e58f11dc045ce2feb3 /Zend/zend_inheritance.c
parent8812350c7af08cfa37282f449fe44d7e6cfa8fff (diff)
downloadphp-git-f2e88512451ba0d48252eaf206a0f242a8cd3ddb.tar.gz
Remove func copy optimization for private method with static vars
Not NULLing the static_variables pointer for shadow methods during static var shutdown would be a way to avoid this leak, but unless there's evidence that inherited private methods with static vars are actually a common use-case, I don't think we should keep this kind of fragile edge-case optimization. Fixes OSS-Fuzz #17875.
Diffstat (limited to 'Zend/zend_inheritance.c')
-rw-r--r--Zend/zend_inheritance.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c
index 30899982c8..4288d8fb59 100644
--- a/Zend/zend_inheritance.c
+++ b/Zend/zend_inheritance.c
@@ -101,15 +101,6 @@ static zend_always_inline zend_function *zend_duplicate_function(zend_function *
/* reuse the same op_array structure */
return func;
}
- if (func->op_array.fn_flags & ZEND_ACC_PRIVATE) {
- /* For private methods we reuse the same op_array structure even if
- * static variables are used, because it will not end up being used
- * anyway. However we still need to addref as the dtor will delref. */
- if (!(GC_FLAGS(func->op_array.static_variables) & IS_ARRAY_IMMUTABLE)) {
- GC_ADDREF(func->op_array.static_variables);
- }
- return func;
- }
return zend_duplicate_user_function(func);
}
}