@@ -1028,6 +1028,41 @@ static zend_property_info *zend_persist_property_info(zend_property_info *prop)
10281028 return prop ;
10291029}
10301030
1031+ static zend_property_info * zend_persist_substituted_property_info (zend_property_info * prop )
1032+ {
1033+ zend_class_entry * ce ;
1034+ prop = zend_shared_memdup_put (prop , sizeof (zend_property_info ));
1035+ ce = zend_shared_alloc_get_xlat_entry (prop -> ce );
1036+ if (ce ) {
1037+ prop -> ce = ce ;
1038+ }
1039+
1040+ if (prop -> prototype ) {
1041+ const zend_property_info * xlat_proto = zend_shared_alloc_get_xlat_entry (prop -> prototype );
1042+ if (xlat_proto ) {
1043+ prop -> prototype = xlat_proto ;
1044+ }
1045+ }
1046+
1047+ zend_persist_type (& prop -> type );
1048+ if (prop -> hooks ) {
1049+ prop -> hooks = zend_shared_memdup_put (prop -> hooks , ZEND_PROPERTY_HOOK_STRUCT_SIZE );
1050+ for (uint32_t i = 0 ; i < ZEND_PROPERTY_HOOK_COUNT ; i ++ ) {
1051+ if (prop -> hooks [i ]) {
1052+ zend_op_array * hook = zend_persist_class_method (& prop -> hooks [i ]-> op_array , prop -> ce );
1053+ const zend_property_info * new_prop_info = zend_shared_alloc_get_xlat_entry (hook -> prop_info );
1054+ if (new_prop_info ) {
1055+ hook -> prop_info = new_prop_info ;
1056+ }
1057+
1058+ prop -> hooks [i ] = (zend_function * ) hook ;
1059+ }
1060+ }
1061+ }
1062+
1063+ return prop ;
1064+ }
1065+
10311066static void zend_persist_class_constant (zval * zv )
10321067{
10331068 const zend_class_constant * orig_c = Z_PTR_P (zv );
@@ -1163,9 +1198,11 @@ zend_class_entry *zend_persist_class_entry(zend_class_entry *orig_ce)
11631198 if (prop -> ce == orig_ce ) {
11641199 Z_PTR (p -> val ) = zend_persist_property_info (prop );
11651200 } else {
1166- prop = zend_shared_alloc_get_xlat_entry (prop );
1167- if (prop ) {
1168- Z_PTR (p -> val ) = prop ;
1201+ zend_property_info * xlat_prop = zend_shared_alloc_get_xlat_entry (prop );
1202+ if (xlat_prop ) {
1203+ Z_PTR (p -> val ) = xlat_prop ;
1204+ } else if (!zend_accel_in_shm (prop )) {
1205+ Z_PTR (p -> val ) = zend_persist_substituted_property_info (prop );
11691206 } else {
11701207 /* This can happen if preloading is used and we inherit a property from an
11711208 * internal class. In that case we should keep pointing to the internal
0 commit comments