Skip to content

Commit f02fd58

Browse files
committed
Get rid of impossible error branch
1 parent 88449f6 commit f02fd58

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ext/dom/dom_iterators.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,10 @@ static void php_dom_iterator_move_forward(zend_object_iterator *iter) /* {{{ */
206206
/* The collection is live, we nav the tree from the base object if we cannot
207207
* use the cache to restart from the last point. */
208208
xmlNodePtr basenode = dom_object_get_node(objmap->baseobj);
209-
if (UNEXPECTED(!basenode)) {
210-
goto err;
211-
}
209+
210+
/* We have a strong reference to the base node via baseobj_zv, this cannot become NULL */
211+
ZEND_ASSERT(basenode != NULL);
212+
212213
int previndex;
213214
if (php_dom_is_cache_tag_stale_from_node(&iterator->cache_tag, basenode)) {
214215
php_dom_mark_cache_tag_up_to_date_from_node(&iterator->cache_tag, basenode);
@@ -234,7 +235,7 @@ static void php_dom_iterator_move_forward(zend_object_iterator *iter) /* {{{ */
234235
}
235236
}
236237
}
237-
err:
238+
238239
zval_ptr_dtor(&iterator->curobj);
239240
ZVAL_UNDEF(&iterator->curobj);
240241

0 commit comments

Comments
 (0)