summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKalle Sommer Nielsen <kalle@php.net>2018-10-03 11:36:30 +0200
committerKalle Sommer Nielsen <kalle@php.net>2018-10-03 11:36:30 +0200
commitb1f6390f1669bb716e3d427e425e5602080653f7 (patch)
treec5b41c83ca0c1a382f38ae8442227a0e5ae7ebf6
parentc11632679366cf8c3f2a7a9cfef77115891c9e71 (diff)
parentafcc785399dee5fbf2802211e82696b8c1c6093c (diff)
downloadphp-git-b1f6390f1669bb716e3d427e425e5602080653f7.tar.gz
Merge branch 'master' of git.php.net:/php-src
-rw-r--r--Zend/zend_execute.c2
-rw-r--r--Zend/zend_inheritance.c5
2 files changed, 7 insertions, 0 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index e204ae5989..cbaa53f4e1 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -2581,6 +2581,7 @@ static zend_always_inline void i_init_code_execute_data(zend_execute_data *execu
zend_attach_symbol_table(execute_data);
if (!op_array->run_time_cache) {
+ ZEND_ASSERT(op_array->fn_flags & ZEND_ACC_HEAP_RT_CACHE);
op_array->run_time_cache = emalloc(op_array->cache_size);
memset(op_array->run_time_cache, 0, op_array->cache_size);
}
@@ -2618,6 +2619,7 @@ ZEND_API void zend_init_code_execute_data(zend_execute_data *execute_data, zend_
{
EX(prev_execute_data) = EG(current_execute_data);
if (!op_array->run_time_cache) {
+ ZEND_ASSERT(op_array->fn_flags & ZEND_ACC_HEAP_RT_CACHE);
op_array->run_time_cache = emalloc(op_array->cache_size);
memset(op_array->run_time_cache, 0, op_array->cache_size);
}
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c
index 816d67e851..5b10bdc5c2 100644
--- a/Zend/zend_inheritance.c
+++ b/Zend/zend_inheritance.c
@@ -639,6 +639,11 @@ static zend_function *do_inherit_method(zend_string *key, zend_function *parent,
zend_function *func = (zend_function*)Z_PTR_P(child);
zend_function *orig_prototype = func->common.prototype;
+ if (UNEXPECTED(func == parent)) {
+ /* The same method in interface may be inhereted few times */
+ return NULL;
+ }
+
do_inheritance_check_on_method(func, parent);
if (func->common.prototype != orig_prototype &&
func->type == ZEND_USER_FUNCTION &&