Skip to content

Commit

Permalink
fix Meta.partially_inline! again (#39112)
Browse files Browse the repository at this point in the history
forgot to take `statement_offset` into account in #38519

(cherry picked from commit 9f8bdc2)
  • Loading branch information
simeonschaub authored and staticfloat committed Jan 15, 2021
1 parent 9071d15 commit a4bd7f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/meta.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions test/meta.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit a4bd7f5

Please sign in to comment.