Skip to content

Commit

Permalink
workaround for #40048, stack overflow in type intersection
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Jun 9, 2021
1 parent 482d0ac commit 9a98e39
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1597,6 +1597,8 @@ static int jl_type_intersection2(jl_value_t *t1, jl_value_t *t2, jl_value_t **is
*isect = jl_type_intersection_env_s(t1, t2, NULL, &is_subty);
if (*isect == jl_bottom_type)
return 0;
// TODO: This extra call to intersection sometimes hits bad cases, e.g. issue #40048.
/*
if (is_subty)
return 1;
// TODO: sometimes type intersection returns types with free variables
Expand All @@ -1613,6 +1615,7 @@ static int jl_type_intersection2(jl_value_t *t1, jl_value_t *t2, jl_value_t **is
if (jl_types_egal(*isect2, *isect)) {
*isect2 = NULL;
}
*/
return 1;
}

Expand Down

0 comments on commit 9a98e39

Please sign in to comment.