Skip to content

Commit efacc3c

Browse files
committed
Add some assertions
1 parent de5f6a8 commit efacc3c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Zend/zend_compile.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,12 +1199,16 @@ static zend_string *add_intersection_type(zend_string *str,
11991199
zend_string *intersection_str = NULL;
12001200

12011201
ZEND_TYPE_LIST_FOREACH(intersection_type_list, single_type) {
1202+
ZEND_ASSERT(!ZEND_TYPE_HAS_LIST(*single_type));
1203+
ZEND_ASSERT(ZEND_TYPE_HAS_NAME(*single_type));
12021204
zend_string *name = ZEND_TYPE_NAME(*single_type);
12031205
zend_string *resolved = resolve_class_name(name, scope);
12041206
intersection_str = add_type_string(intersection_str, resolved, /* is_intersection */ true);
12051207
zend_string_release(resolved);
12061208
} ZEND_TYPE_LIST_FOREACH_END();
12071209

1210+
ZEND_ASSERT(intersection_str);
1211+
12081212
if (is_bracketed) {
12091213
zend_string *result = zend_string_concat3("(", 1, ZSTR_VAL(intersection_str), ZSTR_LEN(intersection_str), ")", 1);
12101214
zend_string_release(intersection_str);

0 commit comments

Comments
 (0)