@@ -2700,13 +2700,13 @@ static jl_value_t *ml_matches(jl_methtable_t *mt, int offs,
2700
2700
// done with many of these values now
2701
2701
env .match .ti = NULL ; env .matc = NULL ; env .match .env = NULL ; search .env = NULL ;
2702
2702
size_t i , j , len = jl_array_len (env .t );
2703
+ jl_method_match_t * minmax = NULL ;
2704
+ int minmax_ambig = 0 ;
2705
+ int all_subtypes = 1 ;
2703
2706
if (len > 1 ) {
2704
2707
// first try to pre-process the results to find the most specific result that fully covers the input
2705
2708
// (since we can do this in linear time, and the rest is O(n^2)
2706
2709
// - first see if this might even be profitable, given the requested output we need to compute
2707
- jl_method_match_t * minmax = NULL ;
2708
- int minmax_ambig = 0 ;
2709
- int all_subtypes = 1 ;
2710
2710
for (i = 0 ; i < len ; i ++ ) {
2711
2711
jl_method_match_t * matc = (jl_method_match_t * )jl_array_ptr_ref (env .t , i );
2712
2712
if (matc -> fully_covers != FULLY_COVERS ) {
@@ -2771,21 +2771,20 @@ static jl_value_t *ml_matches(jl_methtable_t *mt, int offs,
2771
2771
if (all_subtypes ) {
2772
2772
if (minmax_ambig ) {
2773
2773
if (!include_ambiguous ) {
2774
- JL_GC_POP () ;
2775
- return jl_an_empty_vec_any ;
2774
+ len = 0 ;
2775
+ env . t = jl_an_empty_vec_any ;
2776
2776
}
2777
2777
}
2778
2778
else {
2779
2779
assert (minmax != NULL );
2780
2780
jl_array_ptr_set (env .t , 0 , minmax );
2781
2781
jl_array_del_end ((jl_array_t * )env .t , len - 1 );
2782
- JL_GC_POP ();
2783
- if (lim == 0 )
2784
- return jl_false ;
2785
- return env .t ;
2782
+ len = 1 ;
2786
2783
}
2787
2784
}
2788
2785
}
2786
+ }
2787
+ if (len > 1 ) {
2789
2788
// need to partially domsort the graph now into a list
2790
2789
// (this is an insertion sort attempt)
2791
2790
// if we have a minmax method, we ignore anything less specific
0 commit comments