Skip to content

Commit

Permalink
Fix partially_inline for unreachable
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses authored Dec 9, 2024
1 parent 7192df7 commit 723dee2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions base/meta.jl
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,15 @@ function _partially_inline!(@nospecialize(x), slot_replacements::Vector{Any},
return x
end
if isa(x, Core.ReturnNode)
# Unreachable doesn't have val defined
if !isdefined(x, :val)
return x
else
return Core.ReturnNode(
_partially_inline!(x.val, slot_replacements, type_signature, static_param_values,
slot_offset, statement_offset, boundscheck),
)
end
end
if isa(x, Core.GotoIfNot)
return Core.GotoIfNot(
Expand Down

0 comments on commit 723dee2

Please sign in to comment.