From 15bcf1bb2f53d7cd2a7348a555d2f9d1867ce271 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Thu, 13 Jul 2023 21:01:33 +0000 Subject: [PATCH] gf: remove unnecessary assert cycle==depth We do not care about this condition (the point of this fast path is to skip checking it). Fix #50450 --- src/gf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gf.c b/src/gf.c index 294e1fccb8783..1d3caf4c3c060 100644 --- a/src/gf.c +++ b/src/gf.c @@ -3426,7 +3426,9 @@ static int sort_mlmatches(jl_array_t *t, size_t idx, arraylist_t *visited, array } } if ((size_t)visited->items[idx] == 1) { - assert(cycle == depth); + // n.b. cycle might be < depth, if we had a cycle with a child + // idx, but since we are on the top of the stack, nobody + // observed that and so we are content to ignore this size_t childidx = (size_t)arraylist_pop(stack); assert(childidx == idx); (void)childidx; assert(!subt || *found_minmax == 2);