@@ -178,7 +178,7 @@ static int has_backedge_to_worklist(jl_method_instance_t *mi, htable_t *visited,
178178 int depth = stack -> len ;
179179 * bp = (void * )((char * )HT_NOTFOUND + 4 + depth ); // preliminarily mark as in-progress
180180 size_t i = 0 , n = jl_array_len (mi -> backedges );
181- int cycle = 0 ;
181+ int cycle = depth ;
182182 while (i < n ) {
183183 jl_method_instance_t * be ;
184184 i = get_next_edge (mi -> backedges , i , NULL , & be );
@@ -194,7 +194,7 @@ static int has_backedge_to_worklist(jl_method_instance_t *mi, htable_t *visited,
194194 assert (cycle );
195195 }
196196 }
197- if (!found && cycle && cycle != depth )
197+ if (!found && cycle != depth )
198198 return cycle + 3 ;
199199 // If we are the top of the current cycle, now mark all other parts of
200200 // our cycle with what we found.
@@ -1002,6 +1002,7 @@ static int jl_verify_graph_edge(size_t *maxvalids2_data, jl_array_t *edges, size
10021002 assert (jl_typeis ((jl_value_t * )callee_ids , jl_array_int32_type ));
10031003 int32_t * idxs = (int32_t * )jl_array_data (callee_ids );
10041004 size_t i , n = jl_array_len (callee_ids );
1005+ cycle = depth ;
10051006 for (i = idxs [0 ] + 1 ; i < n ; i ++ ) {
10061007 int32_t childidx = idxs [i ];
10071008 int child_cycle = jl_verify_graph_edge (maxvalids2_data , edges , childidx , visited , stack );
@@ -1020,7 +1021,7 @@ static int jl_verify_graph_edge(size_t *maxvalids2_data, jl_array_t *edges, size
10201021 }
10211022 }
10221023 size_t max_valid = maxvalids2_data [idx ];
1023- if (max_valid != 0 && cycle && cycle != depth )
1024+ if (max_valid != 0 && cycle != depth )
10241025 return cycle ;
10251026 // If we are the top of the current cycle, now mark all other parts of
10261027 // our cycle with what we found.
0 commit comments