Skip to content

Commit d92bb31

Browse files
committed
fix Meta.partially_inline! again
forgot to take `statement_offset` into account in #38519
1 parent 399f8ba commit d92bb31

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

base/meta.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ function _partially_inline!(@nospecialize(x), slot_replacements::Vector{Any},
354354
return Core.GotoIfNot(
355355
_partially_inline!(x.cond, slot_replacements, type_signature, static_param_values,
356356
slot_offset, statement_offset, boundscheck),
357-
x.dest,
357+
x.dest + statement_offset,
358358
)
359359
end
360360
if isa(x, Expr)

test/meta.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,3 +243,5 @@ g(::Val{x}) where {x} = x ? 1 : 0
243243
ci = code_lowered(g, Tuple{Val{true}})[1]
244244
@test Meta.partially_inline!(ci.code, [], Tuple{typeof(g),Val{true}}, Any[Val{true}], 0, 0, :propagate)[1] ==
245245
Core.GotoIfNot(QuoteNode(Val{true}), 3)
246+
@test Meta.partially_inline!(ci.code, [], Tuple{typeof(g),Val{true}}, Any[Val{true}], 0, 2, :propagate)[1] ==
247+
Core.GotoIfNot(QuoteNode(Val{true}), 5)

0 commit comments

Comments
 (0)