@@ -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,15 @@ 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_ASSERT (Z_TYPE (p -> val ) == IS_ALIAS_PTR );
3617
+ _zend_hash_append (dst , p -> key , & p -> val );
3618
+ zend_hash_del_bucket (src , p );
3619
+ continue ;
3620
+ }
3621
+
3614
3622
if (ce -> info .user .filename != filename ) {
3615
3623
filename = ce -> info .user .filename ;
3616
3624
if (filename ) {
@@ -3904,7 +3912,12 @@ static void preload_link(void)
3904
3912
3905
3913
ZEND_HASH_MAP_FOREACH_STR_KEY_VAL_FROM (EG (class_table ), key , zv , EG (persistent_classes_count )) {
3906
3914
ce = Z_PTR_P (zv );
3907
- ZEND_ASSERT (ce -> type != ZEND_INTERNAL_CLASS );
3915
+
3916
+ /* Possible with internal class aliases */
3917
+ if (ce -> type == ZEND_INTERNAL_CLASS ) {
3918
+ ZEND_ASSERT (Z_TYPE_P (zv ) == IS_ALIAS_PTR );
3919
+ continue ;
3920
+ }
3908
3921
3909
3922
if (!(ce -> ce_flags & (ZEND_ACC_TOP_LEVEL |ZEND_ACC_ANON_CLASS ))
3910
3923
|| (ce -> ce_flags & ZEND_ACC_LINKED )) {
@@ -3990,9 +4003,15 @@ static void preload_link(void)
3990
4003
3991
4004
ZEND_HASH_MAP_REVERSE_FOREACH_VAL (EG (class_table ), zv ) {
3992
4005
ce = Z_PTR_P (zv );
4006
+
4007
+ /* Possible with internal class aliases */
3993
4008
if (ce -> type == ZEND_INTERNAL_CLASS ) {
3994
- break ;
4009
+ if (Z_TYPE_P (zv ) != IS_ALIAS_PTR ) {
4010
+ break ; /* can stop already */
4011
+ }
4012
+ continue ;
3995
4013
}
4014
+
3996
4015
if ((ce -> ce_flags & ZEND_ACC_LINKED ) && !(ce -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED )) {
3997
4016
if (!(ce -> ce_flags & ZEND_ACC_TRAIT )) { /* don't update traits */
3998
4017
CG (in_compilation ) = true; /* prevent autoloading */
@@ -4009,7 +4028,13 @@ static void preload_link(void)
4009
4028
ZEND_HASH_MAP_FOREACH_STR_KEY_VAL_FROM (
4010
4029
EG (class_table ), key , zv , EG (persistent_classes_count )) {
4011
4030
ce = Z_PTR_P (zv );
4012
- ZEND_ASSERT (ce -> type != ZEND_INTERNAL_CLASS );
4031
+
4032
+ /* Possible with internal class aliases */
4033
+ if (ce -> type == ZEND_INTERNAL_CLASS ) {
4034
+ ZEND_ASSERT (Z_TYPE_P (zv ) == IS_ALIAS_PTR );
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