1
0
mirror of https://github.com/php/php-src.git synced 2026-04-18 21:41:22 +02:00

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
This commit is contained in:
Dmitry Stogov
2021-11-18 14:17:36 +03:00
parent 36d2d27980
commit 5ab2749263

View File

@@ -2428,11 +2428,12 @@ static zend_class_entry* zend_accel_inheritance_cache_add(zend_class_entry *ce,
}
entry->ce = new_ce = zend_persist_class_entry(ce);
zend_update_parent_ce(new_ce);
entry->next = proto->inheritance_cache;
proto->inheritance_cache = entry;
entry->num_warnings = EG(num_errors);
entry->warnings = zend_persist_warnings(EG(num_errors), EG(errors));
entry->next = proto->inheritance_cache;
proto->inheritance_cache = entry;
EG(num_errors) = 0;
EG(errors) = NULL;