@@ -3522,7 +3522,7 @@ static void preload_shutdown(void)
3522
3522
if (EG (class_table )) {
3523
3523
ZEND_HASH_MAP_REVERSE_FOREACH_VAL (EG (class_table ), zv ) {
3524
3524
zend_class_entry * ce = Z_PTR_P (zv );
3525
- if (ce -> type == ZEND_INTERNAL_CLASS ) {
3525
+ if (ce -> type == ZEND_INTERNAL_CLASS && Z_TYPE_P ( zv ) != IS_ALIAS_PTR ) {
3526
3526
break ;
3527
3527
}
3528
3528
} ZEND_HASH_MAP_FOREACH_END_DEL ();
@@ -3610,7 +3610,14 @@ static void preload_move_user_classes(HashTable *src, HashTable *dst)
3610
3610
zend_hash_extend (dst , dst -> nNumUsed + src -> nNumUsed , 0 );
3611
3611
ZEND_HASH_MAP_FOREACH_BUCKET_FROM (src , p , EG (persistent_classes_count )) {
3612
3612
zend_class_entry * ce = Z_PTR (p -> val );
3613
- ZEND_ASSERT (ce -> type == ZEND_USER_CLASS );
3613
+
3614
+ /* Possible with internal class aliases */
3615
+ if (ce -> type == ZEND_INTERNAL_CLASS ) {
3616
+ _zend_hash_append (dst , p -> key , & p -> val );
3617
+ zend_hash_del_bucket (src , p );
3618
+ continue ;
3619
+ }
3620
+
3614
3621
if (ce -> info .user .filename != filename ) {
3615
3622
filename = ce -> info .user .filename ;
3616
3623
if (filename ) {
@@ -3904,7 +3911,11 @@ static void preload_link(void)
3904
3911
3905
3912
ZEND_HASH_MAP_FOREACH_STR_KEY_VAL_FROM (EG (class_table ), key , zv , EG (persistent_classes_count )) {
3906
3913
ce = Z_PTR_P (zv );
3907
- ZEND_ASSERT (ce -> type != ZEND_INTERNAL_CLASS );
3914
+
3915
+ /* Possible with internal class aliases */
3916
+ if (ce -> type == ZEND_INTERNAL_CLASS ) {
3917
+ continue ;
3918
+ }
3908
3919
3909
3920
if (!(ce -> ce_flags & (ZEND_ACC_TOP_LEVEL |ZEND_ACC_ANON_CLASS ))
3910
3921
|| (ce -> ce_flags & ZEND_ACC_LINKED )) {
@@ -3990,9 +4001,15 @@ static void preload_link(void)
3990
4001
3991
4002
ZEND_HASH_MAP_REVERSE_FOREACH_VAL (EG (class_table ), zv ) {
3992
4003
ce = Z_PTR_P (zv );
4004
+
4005
+ /* Possible with internal class aliases */
3993
4006
if (ce -> type == ZEND_INTERNAL_CLASS ) {
3994
- break ;
4007
+ if (Z_TYPE_P (zv ) != IS_ALIAS_PTR ) {
4008
+ break ; /* can stop already */
4009
+ }
4010
+ continue ;
3995
4011
}
4012
+
3996
4013
if ((ce -> ce_flags & ZEND_ACC_LINKED ) && !(ce -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED )) {
3997
4014
if (!(ce -> ce_flags & ZEND_ACC_TRAIT )) { /* don't update traits */
3998
4015
CG (in_compilation ) = true; /* prevent autoloading */
@@ -4009,7 +4026,15 @@ static void preload_link(void)
4009
4026
ZEND_HASH_MAP_FOREACH_STR_KEY_VAL_FROM (
4010
4027
EG (class_table ), key , zv , EG (persistent_classes_count )) {
4011
4028
ce = Z_PTR_P (zv );
4012
- ZEND_ASSERT (ce -> type != ZEND_INTERNAL_CLASS );
4029
+
4030
+ /* Possible with internal class aliases */
4031
+ if (ce -> type == ZEND_INTERNAL_CLASS ) {
4032
+ if (Z_TYPE_P (zv ) != IS_ALIAS_PTR ) {
4033
+ break ; /* can stop already */
4034
+ }
4035
+ continue ;
4036
+ }
4037
+
4013
4038
if ((ce -> ce_flags & (ZEND_ACC_TOP_LEVEL |ZEND_ACC_ANON_CLASS ))
4014
4039
&& !(ce -> ce_flags & ZEND_ACC_LINKED )) {
4015
4040
zend_string * lcname = zend_string_tolower (ce -> name );
0 commit comments