Don't track internal class dependencies

Subtyping relationships established on internal classes are always
going to hold (if we ignore Windows), so there is no need to
explicitly track them.

This fixes an assertion failure in GH-7251.
This commit is contained in:
Nikita Popov 2021-07-19 10:53:22 +02:00
parent 58fb147cde
commit a837d35366

View File

@ -376,13 +376,17 @@ static void track_class_dependency(zend_class_entry *ce, zend_string *class_name
return;
}
#ifndef ZEND_WIN32
/* On non-Windows systems, internal classes are always the same,
* so there is no need to explicitly track them. */
if (ce->type == ZEND_INTERNAL_CLASS) {
return;
}
#endif
ht = (HashTable*)CG(current_linking_class)->inheritance_cache;
#ifndef ZEND_WIN32
if (ce->type == ZEND_USER_CLASS && !(ce->ce_flags & ZEND_ACC_IMMUTABLE)) {
#else
if (!(ce->ce_flags & ZEND_ACC_IMMUTABLE)) {
#endif
// TODO: dependency on not-immutable class ???
if (ht) {
zend_hash_destroy(ht);