Skip to content

Commit a690e1a

Browse files
committed
Simplify zend_link_hooked_object_iter()
We don't need to free inheritance_cache, since at this point we haven't gotten around to tracking any dependencies.
1 parent 8c5aff6 commit a690e1a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Zend/zend_inheritance.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,12 +1755,12 @@ static void zend_link_hooked_object_iter(zend_class_entry *ce) {
17551755
ce->get_iterator = zend_hooked_object_get_iterator;
17561756
ce->ce_flags &= ~ZEND_ACC_CACHEABLE;
17571757
if (CG(current_linking_class) == ce) {
1758+
# if ZEND_DEBUG
1759+
/* This check is executed before inheriting any elements that can
1760+
* track dependencies. */
17581761
HashTable *ht = (HashTable*)ce->inheritance_cache;
1759-
if (ht) {
1760-
zend_hash_destroy(ht);
1761-
FREE_HASHTABLE(ht);
1762-
ce->inheritance_cache = NULL;
1763-
}
1762+
ZEND_ASSERT(!ht);
1763+
# endif
17641764
CG(current_linking_class) = NULL;
17651765
}
17661766
}

0 commit comments

Comments
 (0)