@@ -1378,7 +1378,8 @@ ZEND_API zend_result zend_update_class_constants(zend_class_entry *class_type) /
1378
1378
return SUCCESS ;
1379
1379
}
1380
1380
1381
- if (ce_flags & ZEND_ACC_IMMUTABLE ) {
1381
+ bool uses_mutable_data = ZEND_MAP_PTR (class_type -> mutable_data ) != NULL ;
1382
+ if (uses_mutable_data ) {
1382
1383
mutable_data = ZEND_MAP_PTR_GET_IMM (class_type -> mutable_data );
1383
1384
if (mutable_data ) {
1384
1385
ce_flags = mutable_data -> ce_flags ;
@@ -1399,7 +1400,7 @@ ZEND_API zend_result zend_update_class_constants(zend_class_entry *class_type) /
1399
1400
if (ce_flags & ZEND_ACC_HAS_AST_CONSTANTS ) {
1400
1401
HashTable * constants_table ;
1401
1402
1402
- if (ce_flags & ZEND_ACC_IMMUTABLE ) {
1403
+ if (uses_mutable_data ) {
1403
1404
constants_table = mutable_data -> constants_table ;
1404
1405
if (!constants_table ) {
1405
1406
constants_table = zend_separate_class_constants_table (class_type );
@@ -1426,8 +1427,7 @@ ZEND_API zend_result zend_update_class_constants(zend_class_entry *class_type) /
1426
1427
}
1427
1428
1428
1429
default_properties_table = class_type -> default_properties_table ;
1429
- if ((ce_flags & ZEND_ACC_IMMUTABLE )
1430
- && (ce_flags & ZEND_ACC_HAS_AST_PROPERTIES )) {
1430
+ if (uses_mutable_data && (ce_flags & ZEND_ACC_HAS_AST_PROPERTIES )) {
1431
1431
zval * src , * dst , * end ;
1432
1432
1433
1433
default_properties_table = mutable_data -> default_properties_table ;
@@ -1475,15 +1475,10 @@ ZEND_API zend_result zend_update_class_constants(zend_class_entry *class_type) /
1475
1475
ce_flags |= ZEND_ACC_CONSTANTS_UPDATED ;
1476
1476
ce_flags &= ~ZEND_ACC_HAS_AST_CONSTANTS ;
1477
1477
ce_flags &= ~ZEND_ACC_HAS_AST_PROPERTIES ;
1478
- if (class_type -> ce_flags & ZEND_ACC_IMMUTABLE ) {
1479
- ce_flags &= ~ZEND_ACC_HAS_AST_STATICS ;
1480
- if (mutable_data ) {
1481
- mutable_data -> ce_flags = ce_flags ;
1482
- }
1478
+ ce_flags &= ~ZEND_ACC_HAS_AST_STATICS ;
1479
+ if (uses_mutable_data ) {
1480
+ mutable_data -> ce_flags = ce_flags ;
1483
1481
} else {
1484
- if (!(ce_flags & ZEND_ACC_PRELOADED )) {
1485
- ce_flags &= ~ZEND_ACC_HAS_AST_STATICS ;
1486
- }
1487
1482
class_type -> ce_flags = ce_flags ;
1488
1483
}
1489
1484
0 commit comments