Skip to content

Commit

Permalink
Merge pull request #22249 from JuliaLang/jb/fix22239
Browse files Browse the repository at this point in the history
fix #22239, stack overflow in type intersection
  • Loading branch information
JeffBezanson committed Jun 6, 2017
2 parents 97195d6 + 7cc7520 commit 285ec1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/subtype.c
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@ static jl_value_t *intersect_var(jl_tvar_t *b, jl_value_t *a, jl_stenv_t *e, int
return ub;
}
else if (bb->constraintkind == 0) {
if (!jl_is_typevar(a)) {
if (!jl_is_typevar(bb->ub) && !jl_is_typevar(a)) {
if (try_subtype_in_env(bb->ub, a, e))
return (jl_value_t*)b;
}
Expand Down
5 changes: 5 additions & 0 deletions test/subtype.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1108,3 +1108,8 @@ end
@testintersect(Tuple{Type{B21613{Tuple{L},L}} where L, Any},
Tuple{Type{SA}, Tuple} where SA<:(A21613{S} where S<:Tuple),
Tuple{Type{B21613{Tuple{L},L}} where L, Tuple})

# issue #22239
@testintersect(Val{Pair{T,T}} where T,
Val{Pair{Int,T}} where T,
Val{Pair{Int,Int}})

2 comments on commit 285ec1f

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels

Please sign in to comment.