Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Zend/zend_lazy_objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ static int zlo_hash_remove_dyn_props_func(zval *pDest)

static bool zlo_is_iterating(zend_object *object)
{
if (object->properties && object->properties->u.v.nIteratorsCount) {
if (object->properties && HT_ITERATORS_COUNT(object->properties)) {
return true;
}
if (zend_object_is_lazy_proxy(object)
Expand Down
6 changes: 2 additions & 4 deletions Zend/zend_property_hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ static void zho_dynamic_it_fetch_current(zend_object_iterator *iter)
}

if (hooked_iter->by_ref && Z_TYPE(bucket->val) != IS_REFERENCE) {
ZEND_ASSERT(Z_TYPE(bucket->val) != IS_UNDEF);
ZVAL_MAKE_REF(&bucket->val);
}
ZVAL_COPY(&hooked_iter->current_data, &bucket->val);
Expand Down Expand Up @@ -275,9 +274,8 @@ static void zho_it_rewind(zend_object_iterator *iter)
zend_array *properties = Z_ARR(hooked_iter->declared_props);
zend_hash_internal_pointer_reset(properties);
hooked_iter->dynamic_props_done = false;
if (hooked_iter->dynamic_prop_it != (uint32_t) -1) {
EG(ht_iterators)[hooked_iter->dynamic_prop_it].pos = zho_num_backed_props(Z_OBJ(iter->data));
}
ZEND_ASSERT(hooked_iter->dynamic_prop_it != (uint32_t) -1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer assigned -1 anywhere, so this assert is kinda useless.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right

EG(ht_iterators)[hooked_iter->dynamic_prop_it].pos = zho_num_backed_props(Z_OBJ(iter->data));
}

static HashTable *zho_it_get_gc(zend_object_iterator *iter, zval **table, int *n)
Expand Down
Loading