Skip to content

Commit

Permalink
fix a case where Vararg.T might be accessed when undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Aug 12, 2021
1 parent 9423ac7 commit fcdb63d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/compiler/typelimits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function _limit_type_size(@nospecialize(t), @nospecialize(c), sources::SimpleVec
elseif isa(t, DataType)
if isa(c, Core.TypeofVararg)
# Tuple{Vararg{T}} --> Tuple{T} is OK
return _limit_type_size(t, c.T, sources, depth, 0)
return _limit_type_size(t, unwrapva(c), sources, depth, 0)
elseif isType(t) # allow taking typeof as Type{...}, but ensure it doesn't start nesting
tt = unwrap_unionall(t.parameters[1])
(!isa(tt, DataType) || isType(tt)) && (depth += 1)
Expand Down

0 comments on commit fcdb63d

Please sign in to comment.