Skip to content

Commit defd0a7

Browse files
committed
Slightly simplify abstract_iteration
1 parent 228e0fb commit defd0a7

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

base/compiler/abstractinterpretation.jl

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -860,21 +860,15 @@ function abstract_iteration(interp::AbstractInterpreter, @nospecialize(itft), @n
860860
end
861861
# From here on, we start asking for results on the widened types, rather than
862862
# the precise (potentially const) state type
863-
statetype = widenconst(statetype)
864863
valtype = widenconst(valtype)
865-
if statetype === Bottom
866-
stateordonet = abstract_call_known(interp, iteratef, nothing, Any[Const(iteratef), itertype], sv).rt
867-
else
868-
stateordonet = abstract_call_known(interp, iteratef, nothing, Any[Const(iteratef), itertype, statetype], sv).rt
869-
end
870864
while valtype !== Any
871865
stateordonet = widenconst(stateordonet)
872866
nounion = typesubtract(stateordonet, Nothing, 0)
873867
if !isa(nounion, DataType) || !(nounion <: Tuple) || isvatuple(nounion) || length(nounion.parameters) != 2
874868
valtype = Any
875869
break
876870
end
877-
if nounion.parameters[1] <: valtype && nounion.parameters[2] <: statetype
871+
if nounion.parameters[1] <: valtype && nounion.parameters[2] statetype
878872
if typeintersect(stateordonet, Nothing) === Union{}
879873
# Reached a fixpoint, but Nothing is not possible => iterator is infinite or failing
880874
return Any[Bottom], nothing

0 commit comments

Comments
 (0)