From c63fc5d5f19c58498108d1698055b2b442227eb3 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 17 Oct 2018 11:36:51 +0300 Subject: [PATCH] Moved static class members initialization into the proper place. --- Zend/zend_inheritance.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index 3468fb3a883..afc01fc9ab7 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -885,6 +885,10 @@ 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 (UNEXPECTED(zend_update_class_constants(parent_ce) != SUCCESS)) { @@ -901,10 +905,6 @@ 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 (UNEXPECTED(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); - } src = CE_STATIC_MEMBERS(parent_ce) + parent_ce->default_static_members_count; do { dst--;