Skip to content

Commit 5ab2749

Browse files
committed
Fixed a crash becaeuse of race condition in inheritance cache
zend_inheritance_cache_entry.[num_]warnings must be updated before this entry is made visible to other processes
1 parent 36d2d27 commit 5ab2749

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
@@ -2428,11 +2428,12 @@ static zend_class_entry* zend_accel_inheritance_cache_add(zend_class_entry *ce,
24282428
}
24292429
entry->ce = new_ce = zend_persist_class_entry(ce);
24302430
zend_update_parent_ce(new_ce);
2431-
entry->next = proto->inheritance_cache;
2432-
proto->inheritance_cache = entry;
24332431

24342432
entry->num_warnings = EG(num_errors);
24352433
entry->warnings = zend_persist_warnings(EG(num_errors), EG(errors));
2434+
entry->next = proto->inheritance_cache;
2435+
proto->inheritance_cache = entry;
2436+
24362437
EG(num_errors) = 0;
24372438
EG(errors) = NULL;
24382439

0 commit comments

Comments
 (0)