Skip to content

Commit a837d35

Browse files
committed
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.
1 parent 58fb147 commit a837d35

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Zend/zend_inheritance.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,13 +376,17 @@ static void track_class_dependency(zend_class_entry *ce, zend_string *class_name
376376
return;
377377
}
378378

379+
#ifndef ZEND_WIN32
380+
/* On non-Windows systems, internal classes are always the same,
381+
* so there is no need to explicitly track them. */
382+
if (ce->type == ZEND_INTERNAL_CLASS) {
383+
return;
384+
}
385+
#endif
386+
379387
ht = (HashTable*)CG(current_linking_class)->inheritance_cache;
380388

381-
#ifndef ZEND_WIN32
382-
if (ce->type == ZEND_USER_CLASS && !(ce->ce_flags & ZEND_ACC_IMMUTABLE)) {
383-
#else
384389
if (!(ce->ce_flags & ZEND_ACC_IMMUTABLE)) {
385-
#endif
386390
// TODO: dependency on not-immutable class ???
387391
if (ht) {
388392
zend_hash_destroy(ht);

0 commit comments

Comments
 (0)