Skip to content

Commit 0e1c724

Browse files
committed
Merge branch 'PHP-8.1'
* PHP-8.1: Fixed a crash becaeuse of race condition in inheritance cache
2 parents 3ded2db + 5ab2749 commit 0e1c724

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ext/opcache/ZendAccelerator.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2421,11 +2421,12 @@ static zend_class_entry* zend_accel_inheritance_cache_add(zend_class_entry *ce,
24212421
}
24222422
entry->ce = new_ce = zend_persist_class_entry(ce);
24232423
zend_update_parent_ce(new_ce);
2424-
entry->next = proto->inheritance_cache;
2425-
proto->inheritance_cache = entry;
24262424

24272425
entry->num_warnings = EG(num_errors);
24282426
entry->warnings = zend_persist_warnings(EG(num_errors), EG(errors));
2427+
entry->next = proto->inheritance_cache;
2428+
proto->inheritance_cache = entry;
2429+
24292430
EG(num_errors) = 0;
24302431
EG(errors) = NULL;
24312432

0 commit comments

Comments
 (0)