@@ -774,15 +774,14 @@ static void zend_persist_class_method(zval *zv, zend_class_entry *ce)
774
774
}
775
775
op_array = Z_PTR_P (zv ) = zend_shared_memdup_put (op_array , sizeof (zend_op_array ));
776
776
zend_persist_op_array_ex (op_array , NULL );
777
- if ((ce -> ce_flags & ZEND_ACC_LINKED )
778
- && (ce -> ce_flags & ZEND_ACC_IMMUTABLE )) {
777
+ if (ce -> ce_flags & ZEND_ACC_IMMUTABLE ) {
779
778
op_array -> fn_flags |= ZEND_ACC_IMMUTABLE ;
780
- ZEND_MAP_PTR_NEW ( op_array -> run_time_cache );
781
- if (op_array -> static_variables ) {
782
- ZEND_MAP_PTR_NEW (op_array -> static_variables_ptr );
783
- }
784
- } else {
785
- if ( ce -> ce_flags & ZEND_ACC_IMMUTABLE ) {
779
+ if ( ce -> ce_flags & ZEND_ACC_LINKED ) {
780
+ ZEND_MAP_PTR_NEW (op_array -> run_time_cache );
781
+ if (op_array -> static_variables ) {
782
+ ZEND_MAP_PTR_NEW ( op_array -> static_variables_ptr );
783
+ }
784
+ } else {
786
785
ZEND_MAP_PTR_INIT (op_array -> run_time_cache , NULL );
787
786
ZEND_MAP_PTR_INIT (op_array -> static_variables_ptr , NULL );
788
787
}
@@ -870,6 +869,14 @@ zend_class_entry *zend_persist_class_entry(zend_class_entry *orig_ce)
870
869
ce = zend_shared_memdup_put (ce , sizeof (zend_class_entry ));
871
870
if (EXPECTED (!ZCG (current_persistent_script )-> corrupted )) {
872
871
ce -> ce_flags |= ZEND_ACC_IMMUTABLE ;
872
+ if ((ce -> ce_flags & ZEND_ACC_LINKED )
873
+ && !(ce -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED )) {
874
+ ZEND_MAP_PTR_NEW (ce -> mutable_data );
875
+ } else {
876
+ ZEND_MAP_PTR_INIT (ce -> mutable_data , NULL );
877
+ }
878
+ } else {
879
+ ce -> ce_flags |= ZEND_ACC_FILE_CACHED ;
873
880
}
874
881
ce -> inheritance_cache = NULL ;
875
882
@@ -903,15 +910,6 @@ zend_class_entry *zend_persist_class_entry(zend_class_entry *orig_ce)
903
910
zend_persist_zval (& ce -> default_properties_table [i ]);
904
911
}
905
912
}
906
- if ((ce -> ce_flags & ZEND_ACC_IMMUTABLE )
907
- && (ce -> ce_flags & ZEND_ACC_LINKED )
908
- && !(ce -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED )) {
909
- ZEND_MAP_PTR_NEW (ce -> mutable_data );
910
- } else if (ce -> ce_flags & ZEND_ACC_IMMUTABLE ) {
911
- ZEND_MAP_PTR_INIT (ce -> mutable_data , NULL );
912
- } else {
913
- ce -> ce_flags |= ZEND_ACC_FILE_CACHED ;
914
- }
915
913
if (ce -> default_static_members_table ) {
916
914
int i ;
917
915
ce -> default_static_members_table = zend_shared_memdup_free (ce -> default_static_members_table , sizeof (zval ) * ce -> default_static_members_count );
0 commit comments