Skip to content

Commit

Permalink
irinterp: Don't try to access mi.def if it's not a Method (#54003)
Browse files Browse the repository at this point in the history
I don't believe this is reachable from the base compiler pipeline, since
we don't run irinterp on toplevel things, but I am seeing this in
downstream packages.
  • Loading branch information
Keno authored Apr 9, 2024
1 parent 3988860 commit 26070ca
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions base/compiler/inferencestate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -783,9 +783,13 @@ mutable struct IRInterpretationState
for i = 1:length(given_argtypes)
given_argtypes[i] = widenslotwrapper(argtypes[i])
end
given_argtypes = va_process_argtypes(optimizer_lattice(interp), given_argtypes, mi)
argtypes_refined = Bool[!(optimizer_lattice(interp), ir.argtypes[i], given_argtypes[i])
for i = 1:length(given_argtypes)]
if isa(mi.def, Method)
given_argtypes = va_process_argtypes(optimizer_lattice(interp), given_argtypes, mi)
argtypes_refined = Bool[!(optimizer_lattice(interp), ir.argtypes[i], given_argtypes[i])
for i = 1:length(given_argtypes)]
else
argtypes_refined = Bool[false for i = 1:length(given_argtypes)]
end
empty!(ir.argtypes)
append!(ir.argtypes, given_argtypes)
tpdum = TwoPhaseDefUseMap(length(ir.stmts))
Expand Down

0 comments on commit 26070ca

Please sign in to comment.