Skip to content

Commit

Permalink
Copy slottypes before ir conversion
Browse files Browse the repository at this point in the history
This was changed in #49113 and is
usually not a problem, but Cthulhu captures the post-inference but unoptimized
CodeInfo, which was invalidated by the later modification of the slottypes
array. Fix this by copying the slottypes for IRCode construction instead.
  • Loading branch information
Keno committed Apr 15, 2023
1 parent fdeb98a commit 0f39fe5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/compiler/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ function convert_to_ircode(ci::CodeInfo, sv::OptimizationState)
# NOTE this `argtypes` contains types of slots yet: it will be modified to contain the
# types of call arguments only once `slot2reg` converts this `IRCode` to the SSA form
# and eliminates slots (see below)
argtypes = sv.slottypes
argtypes = copy(sv.slottypes)
return IRCode(stmts, cfg, linetable, argtypes, meta, sv.sptypes)
end

Expand Down

0 comments on commit 0f39fe5

Please sign in to comment.