summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-07-04 10:28:12 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-07-04 10:32:36 +0200
commit1fea887cc00ea01fd34bc17860c1d41370f23e53 (patch)
tree841b9bb5f852620b6b244c3a9e3e774b36d785e6
parent09041151de1543b69e74a6a9637455b463700a24 (diff)
downloadphp-git-1fea887cc00ea01fd34bc17860c1d41370f23e53.tar.gz
Set PROPERTY_TYPES_RESOLVED flag for internal classes
Also make sure that the resolution happens before preloading runs.
-rw-r--r--Zend/zend.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/Zend/zend.c b/Zend/zend.c
index c3a99d2df8..af4ac2981c 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -956,7 +956,11 @@ static void zend_resolve_property_types(void) /* {{{ */
zend_property_info *prop_info;
ZEND_HASH_FOREACH_PTR(CG(class_table), ce) {
- if (UNEXPECTED(ce->type == ZEND_INTERNAL_CLASS && ZEND_CLASS_HAS_TYPE_HINTS(ce))) {
+ if (ce->type != ZEND_INTERNAL_CLASS) {
+ continue;
+ }
+
+ if (UNEXPECTED(ZEND_CLASS_HAS_TYPE_HINTS(ce))) {
ZEND_HASH_FOREACH_PTR(&ce->properties_info, prop_info) {
if (ZEND_TYPE_IS_NAME(prop_info->type)) {
zend_string *type_name = ZEND_TYPE_NAME(prop_info->type);
@@ -970,6 +974,7 @@ static void zend_resolve_property_types(void) /* {{{ */
}
} ZEND_HASH_FOREACH_END();
}
+ ce->ce_flags |= ZEND_ACC_PROPERTY_TYPES_RESOLVED;
} ZEND_HASH_FOREACH_END();
}
/* }}} */
@@ -986,6 +991,8 @@ int zend_post_startup(void) /* {{{ */
zend_executor_globals *executor_globals = ts_resource(executor_globals_id);
#endif
+ zend_resolve_property_types();
+
if (zend_post_startup_cb) {
int (*cb)(void) = zend_post_startup_cb;
@@ -995,8 +1002,6 @@ int zend_post_startup(void) /* {{{ */
}
}
- zend_resolve_property_types();
-
#ifdef ZTS
*GLOBAL_FUNCTION_TABLE = *compiler_globals->function_table;
*GLOBAL_CLASS_TABLE = *compiler_globals->class_table;