@@ -1346,36 +1346,70 @@ static zend_always_inline bool zend_jit_verify_type_common(zval *arg, zend_arg_i
1346
1346
zend_class_entry * ce ;
1347
1347
if (ZEND_TYPE_HAS_LIST (arg_info -> type )) {
1348
1348
zend_type * list_type ;
1349
- ZEND_TYPE_LIST_FOREACH (ZEND_TYPE_LIST (arg_info -> type ), list_type ) {
1350
- if (* cache_slot ) {
1351
- ce = * cache_slot ;
1352
- } else {
1353
- zend_string * name = ZEND_TYPE_NAME (* list_type );
1349
+ if (ZEND_TYPE_HAS_INTERSECTION (arg_info -> type )) {
1350
+ ZEND_TYPE_LIST_FOREACH (ZEND_TYPE_LIST (arg_info -> type ), list_type ) {
1351
+ if (* cache_slot ) {
1352
+ ce = * cache_slot ;
1353
+ } else {
1354
+ zend_string * name = ZEND_TYPE_NAME (* list_type );
1354
1355
1355
- if (ZSTR_HAS_CE_CACHE (name )) {
1356
- ce = ZSTR_GET_CE_CACHE (name );
1357
- if (!ce ) {
1358
- ce = zend_lookup_class_ex (name , NULL , ZEND_FETCH_CLASS_NO_AUTOLOAD );
1356
+ if (ZSTR_HAS_CE_CACHE (name )) {
1357
+ ce = ZSTR_GET_CE_CACHE (name );
1359
1358
if (!ce ) {
1360
- cache_slot ++ ;
1361
- continue ;
1359
+ ce = zend_lookup_class_ex (name , NULL , ZEND_FETCH_CLASS_NO_AUTOLOAD );
1360
+ if (!ce ) {
1361
+ /* Cannot resolve */
1362
+ return false;
1363
+ }
1364
+ }
1365
+ } else {
1366
+ ce = zend_fetch_class (name ,
1367
+ ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_NO_AUTOLOAD | ZEND_FETCH_CLASS_SILENT );
1368
+ if (!ce ) {
1369
+ /* Cannot resolve */
1370
+ return false;
1362
1371
}
1363
1372
}
1373
+ * cache_slot = ce ;
1374
+ }
1375
+ if (!instanceof_function (Z_OBJCE_P (arg ), ce )) {
1376
+ return false;
1377
+ }
1378
+ cache_slot ++ ;
1379
+ } ZEND_TYPE_LIST_FOREACH_END ();
1380
+ return true;
1381
+ } else {
1382
+ ZEND_TYPE_LIST_FOREACH (ZEND_TYPE_LIST (arg_info -> type ), list_type ) {
1383
+ if (* cache_slot ) {
1384
+ ce = * cache_slot ;
1364
1385
} else {
1365
- ce = zend_fetch_class (name ,
1366
- ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_NO_AUTOLOAD | ZEND_FETCH_CLASS_SILENT );
1367
- if (!ce ) {
1368
- cache_slot ++ ;
1369
- continue ;
1386
+ zend_string * name = ZEND_TYPE_NAME (* list_type );
1387
+
1388
+ if (ZSTR_HAS_CE_CACHE (name )) {
1389
+ ce = ZSTR_GET_CE_CACHE (name );
1390
+ if (!ce ) {
1391
+ ce = zend_lookup_class_ex (name , NULL , ZEND_FETCH_CLASS_NO_AUTOLOAD );
1392
+ if (!ce ) {
1393
+ cache_slot ++ ;
1394
+ continue ;
1395
+ }
1396
+ }
1397
+ } else {
1398
+ ce = zend_fetch_class (name ,
1399
+ ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_NO_AUTOLOAD | ZEND_FETCH_CLASS_SILENT );
1400
+ if (!ce ) {
1401
+ cache_slot ++ ;
1402
+ continue ;
1403
+ }
1370
1404
}
1405
+ * cache_slot = ce ;
1371
1406
}
1372
- * cache_slot = ce ;
1373
- }
1374
- if (instanceof_function (Z_OBJCE_P (arg ), ce )) {
1375
- return 1 ;
1376
- }
1377
- cache_slot ++ ;
1378
- } ZEND_TYPE_LIST_FOREACH_END ();
1407
+ if (instanceof_function (Z_OBJCE_P (arg ), ce )) {
1408
+ return 1 ;
1409
+ }
1410
+ cache_slot ++ ;
1411
+ } ZEND_TYPE_LIST_FOREACH_END ();
1412
+ }
1379
1413
} else {
1380
1414
if (EXPECTED (* cache_slot )) {
1381
1415
ce = (zend_class_entry * ) * cache_slot ;
0 commit comments