File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -6281,20 +6281,22 @@ static zend_type zend_compile_typename(
6281
6281
uint32_t single_type_mask ;
6282
6282
6283
6283
if (type_ast -> kind == ZEND_AST_TYPE_INTERSECTION ) {
6284
- if (type_list -> num_types == 0 ) {
6285
- /* The first class type can be stored directly as the type ptr payload. */
6286
- if (ZEND_TYPE_HAS_NAME (type ) || ZEND_TYPE_HAS_CE (type ) || ZEND_TYPE_HAS_CE_CACHE (type )) {
6287
- /* Switch from single name to name list. */
6288
- type_list -> num_types = 1 ;
6289
- type_list -> types [0 ] = type ;
6290
- ZEND_TYPE_FULL_MASK (type_list -> types [0 ]) &= ~_ZEND_TYPE_MAY_BE_MASK ;
6291
- }
6292
- /* TODO Check for trivially redundant class types? */
6284
+ /* The first class type can be stored directly as the type ptr payload. */
6285
+ if (ZEND_TYPE_IS_COMPLEX (type ) && !ZEND_TYPE_HAS_LIST (type )) {
6286
+ /* Switch from single name to name list. */
6287
+ type_list -> num_types = 1 ;
6288
+ type_list -> types [0 ] = type ;
6289
+ /* Reset flags for first type */
6290
+ ZEND_TYPE_FULL_MASK (type_list -> types [0 ]) &= ~_ZEND_TYPE_MAY_BE_MASK ;
6293
6291
ZEND_TYPE_SET_LIST (type , type_list );
6294
6292
}
6295
6293
6296
6294
single_type = zend_compile_typename (type_ast , false);
6295
+ ZEND_ASSERT (ZEND_TYPE_IS_INTERSECTION (single_type ));
6296
+
6297
6297
type_list -> types [type_list -> num_types ++ ] = single_type ;
6298
+
6299
+ /* TODO Check for trivially redundant class types? */
6298
6300
continue ;
6299
6301
}
6300
6302
You can’t perform that action at this time.
0 commit comments