com php-src: Avoid method compatibility check with itself: Zend/zend_inheritance.c
| From: | Dmitry Stogov | Date: | Wed, 03 Oct 2018 09:32:33 +0000 |
| Subject: | com php-src: Avoid method compatibility check with itself: Zend/zend_inheritance.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-103324@lists.php.net to get a copy of this message | ||
Commit: c88b53318fe2609e26d58c9b3c6d5923e1da9736
Author: Dmitry Stogov <dmitry@zend.com> Wed, 3 Oct 2018 12:32:33 +0300
Parents: 9418144054122463585beb0a65445a92757a871d
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c88b53318fe2609e26d58c9b3c6d5923e1da9736
Log:
Avoid method compatibility check with itself
Changed paths:
M Zend/zend_inheritance.c
Diff:
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c
index 816d67e...5b10bdc 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 &&