Skip to content

Commit 9748f30

Browse files
committed
addresses PR comments
1 parent 39e62c2 commit 9748f30

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Zend/zend_API.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2756,7 +2756,7 @@ ZEND_API void zend_add_magic_method(zend_class_entry *ce, zend_function *fptr, z
27562756
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arg_info_toString, 0, 0, IS_STRING, 0)
27572757
ZEND_END_ARG_INFO()
27582758

2759-
static zend_always_inline void upgrade_internal_type(zend_type *type) {
2759+
static zend_always_inline void normalize_internal_type(zend_type *type) {
27602760
ZEND_ASSERT(!ZEND_TYPE_HAS_LITERAL_NAME(*type));
27612761
zend_type *current;
27622762
ZEND_TYPE_FOREACH(*type, current) {
@@ -2767,6 +2767,7 @@ static zend_always_inline void upgrade_internal_type(zend_type *type) {
27672767
} else if (ZEND_TYPE_HAS_LIST(*current)) {
27682768
zend_type *inner;
27692769
ZEND_TYPE_FOREACH(*current, inner) {
2770+
ZEND_ASSERT(!ZEND_TYPE_HAS_LITERAL_NAME(*inner) && !ZEND_TYPE_HAS_LIST(*inner));
27702771
if (ZEND_TYPE_HAS_NAME(*inner)) {
27712772
zend_string *name = zend_new_interned_string(ZEND_TYPE_NAME(*inner));
27722773
zend_alloc_ce_cache(name);
@@ -3009,7 +3010,7 @@ ZEND_API zend_result zend_register_functions(zend_class_entry *scope, const zend
30093010
new_arg_info[i].type = legacy_iterable;
30103011
}
30113012

3012-
upgrade_internal_type(&new_arg_info[i].type);
3013+
normalize_internal_type(&new_arg_info[i].type);
30133014
}
30143015
}
30153016

@@ -4396,7 +4397,7 @@ ZEND_API zend_property_info *zend_declare_typed_property(zend_class_entry *ce, z
43964397
property_info->type = type;
43974398

43984399
if (is_persistent_class(ce)) {
4399-
upgrade_internal_type(&property_info->type);
4400+
normalize_internal_type(&property_info->type);
44004401
}
44014402

44024403
zend_hash_update_ptr(&ce->properties_info, name, property_info);

0 commit comments

Comments
 (0)