diff --git a/base/compiler/ssair/inlining2.jl b/base/compiler/ssair/inlining2.jl index f26540bf61ece..078ef096c4d9f 100644 --- a/base/compiler/ssair/inlining2.jl +++ b/base/compiler/ssair/inlining2.jl @@ -767,7 +767,7 @@ function assemble_inline_todo!(ir::IRCode, linetable::Vector{LineInfoNode}, sv:: for tuparg in ir[def].args[2:end] push!(new_atypes, exprtype(tuparg, ir, ir.mod)) end - elseif (isa(def, Argument) && def === stmt.args[end] && !isempty(sv.result_vargs)) + elseif isa(def, Argument) && def === stmt.args[end] && !isempty(sv.result_vargs) append!(new_atypes, sv.result_vargs) else append!(new_atypes, typ.parameters) diff --git a/test/compiler/compiler.jl b/test/compiler/compiler.jl index 7e078f2b2452d..086d6ba2cebc0 100644 --- a/test/compiler/compiler.jl +++ b/test/compiler/compiler.jl @@ -1536,9 +1536,9 @@ x26826 = rand() apply26826(f, args...) = f(args...) -f26826(x) = apply26826(Base.getproperty, Foo26826(1, x), :b) # We use getproperty to drive these tests because it requires constant # propagation in order to lower to a well-inferred getfield call. +f26826(x) = apply26826(Base.getproperty, Foo26826(1, x), :b) @test @inferred(f26826(x26826)) === x26826 @@ -1554,12 +1554,10 @@ g26826(x) = getfield26826(x, :a, :b) # InferenceResult cache properly for varargs methods. typed_code = Core.Compiler.code_typed(f26826, (Float64,))[1].first.code found_well_typed_getfield_call = false -for stmnt in typed_code - if Meta.isexpr(stmnt, :(=)) && Meta.isexpr(stmnt.args[2], :call) - lhs = stmnt.args[2] - if lhs.args[1] == GlobalRef(Base, :getfield) && lhs.typ === Float64 - global found_well_typed_getfield_call = true - end +for stmt in typed_code + lhs = Meta.isexpr(stmt, :(=)) ? stmt.args[2] : stmt + if Meta.isexpr(lhs, :call) && lhs.args[1] == GlobalRef(Base, :getfield) && lhs.typ === Float64 + global found_well_typed_getfield_call = true end end