Skip to content

Commit b8c347a

Browse files
authored
Thread lattice through tuple_tail_elem (JuliaLang#49643)
1 parent f4d9416 commit b8c347a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

base/compiler/abstractinterpretation.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,7 +1539,7 @@ function abstract_apply(interp::AbstractInterpreter, argtypes::Vector{Any}, si::
15391539
# This is vararg, we're not gonna be able to do any inlining,
15401540
# drop the info
15411541
info = nothing
1542-
tail = tuple_tail_elem(unwrapva(ct[end]), cti)
1542+
tail = tuple_tail_elem(typeinf_lattice(interp), unwrapva(ct[end]), cti)
15431543
push!(ctypes´, push!(ct[1:(end - 1)], tail))
15441544
else
15451545
push!(ctypes´, append!(ct[:], cti))
@@ -1562,7 +1562,7 @@ function abstract_apply(interp::AbstractInterpreter, argtypes::Vector{Any}, si::
15621562
for i = 1:lct-1
15631563
cti = ct[i]
15641564
if isvarargtype(cti)
1565-
ct[i] = tuple_tail_elem(unwrapva(cti), ct[(i+1):lct])
1565+
ct[i] = tuple_tail_elem(typeinf_lattice(interp), unwrapva(cti), ct[(i+1):lct])
15661566
resize!(ct, i)
15671567
break
15681568
end

base/compiler/typelimits.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function _limit_type_size(@nospecialize(t), @nospecialize(c), sources::SimpleVec
138138
Q = Any[ tP[i] for i in 1:np ]
139139
if ltP > np
140140
# combine tp[np:end] into tP[np] using Vararg
141-
Q[np] = tuple_tail_elem(Bottom, Any[ tP[i] for i in np:ltP ])
141+
Q[np] = tuple_tail_elem(fallback_lattice, Bottom, Any[ tP[i] for i in np:ltP ])
142142
end
143143
for i = 1:np
144144
# now apply limit element-wise to Q

base/compiler/typeutils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,11 @@ end
213213
_typename(union::UnionAll) = _typename(union.body)
214214
_typename(a::DataType) = Const(a.name)
215215

216-
function tuple_tail_elem(@nospecialize(init), ct::Vector{Any})
216+
function tuple_tail_elem(𝕃::AbstractLattice, @nospecialize(init), ct::Vector{Any})
217217
t = init
218218
for x in ct
219219
# FIXME: this is broken: it violates subtyping relations and creates invalid types with free typevars
220-
t = tmerge(t, unwraptv(unwrapva(x)))
220+
t = tmerge(𝕃, t, unwraptv(unwrapva(x)))
221221
end
222222
return Vararg{widenconst(t)}
223223
end

0 commit comments

Comments
 (0)