diff --git a/base/meta.jl b/base/meta.jl index 9f545b108353b..98bbcc8cdd358 100644 --- a/base/meta.jl +++ b/base/meta.jl @@ -354,7 +354,7 @@ function _partially_inline!(@nospecialize(x), slot_replacements::Vector{Any}, return Core.GotoIfNot( _partially_inline!(x.cond, slot_replacements, type_signature, static_param_values, slot_offset, statement_offset, boundscheck), - x.dest, + x.dest + statement_offset, ) end if isa(x, Expr) diff --git a/test/meta.jl b/test/meta.jl index e13d986e667e3..ab073668677c6 100644 --- a/test/meta.jl +++ b/test/meta.jl @@ -243,3 +243,5 @@ g(::Val{x}) where {x} = x ? 1 : 0 ci = code_lowered(g, Tuple{Val{true}})[1] @test Meta.partially_inline!(ci.code, [], Tuple{typeof(g),Val{true}}, Any[Val{true}], 0, 0, :propagate)[1] == Core.GotoIfNot(QuoteNode(Val{true}), 3) +@test Meta.partially_inline!(ci.code, [], Tuple{typeof(g),Val{true}}, Any[Val{true}], 0, 2, :propagate)[1] == + Core.GotoIfNot(QuoteNode(Val{true}), 5)