com php-src: Don't initialize static_member_tables during start-up, when inherit internal classes.: Ze nd/zend_inheritance.c
| From: | Dmitry Stogov | Date: | Fri, 19 Oct 2018 10:21:31 +0000 |
| Subject: | com php-src: Don't initialize static_member_tables during start-up, when inherit internal classes.: Ze nd/zend_inheritance.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-103514@lists.php.net to get a copy of this message | ||
Commit: 03384cae3c46254ccfd5d703b408a0f1d011ee3c
Author: Dmitry Stogov <dmitry@zend.com> Fri, 19 Oct 2018 13:21:31 +0300
Parents: 1257664ca2d1403a27e696808eb818c0b92a4eb3
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=03384cae3c46254ccfd5d703b408a0f1d011ee3c
Log:
Don't initialize static_member_tables during start-up, when inherit internal classes.
Changed paths:
M Zend/zend_inheritance.c
Diff:
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c
index ed5a554..174d814 100644
--- a/Zend/zend_inheritance.c
+++ b/Zend/zend_inheritance.c
@@ -885,12 +885,11 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry
*parent
dst = end + parent_ce->default_static_members_count;
ce->default_static_members_table = end;
}
- if (CE_STATIC_MEMBERS(parent_ce) == NULL) {
- ZEND_ASSERT(parent_ce->type == ZEND_INTERNAL_CLASS || (parent_ce->ce_flags &
ZEND_ACC_IMMUTABLE));
- zend_class_init_statics(parent_ce);
- }
if (UNEXPECTED(parent_ce->type != ce->type)) {
/* User class extends internal */
+ if (CE_STATIC_MEMBERS(parent_ce) == NULL) {
+ zend_class_init_statics(parent_ce);
+ }
if (UNEXPECTED(zend_update_class_constants(parent_ce) != SUCCESS)) {
ZEND_ASSERT(0);
}
@@ -905,6 +904,10 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry
*parent
}
} while (dst != end);
} else if (ce->type == ZEND_USER_CLASS) {
+ if (CE_STATIC_MEMBERS(parent_ce) == NULL) {
+ ZEND_ASSERT(parent_ce->ce_flags & ZEND_ACC_IMMUTABLE);
+ zend_class_init_statics(parent_ce);
+ }
src = CE_STATIC_MEMBERS(parent_ce) + parent_ce->default_static_members_count;
do {
dst--;