Skip to content

Commit 26070ca

Browse files
authored
irinterp: Don't try to access mi.def if it's not a Method (#54003)
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.
1 parent 3988860 commit 26070ca

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

base/compiler/inferencestate.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -783,9 +783,13 @@ mutable struct IRInterpretationState
783783
for i = 1:length(given_argtypes)
784784
given_argtypes[i] = widenslotwrapper(argtypes[i])
785785
end
786-
given_argtypes = va_process_argtypes(optimizer_lattice(interp), given_argtypes, mi)
787-
argtypes_refined = Bool[!(optimizer_lattice(interp), ir.argtypes[i], given_argtypes[i])
788-
for i = 1:length(given_argtypes)]
786+
if isa(mi.def, Method)
787+
given_argtypes = va_process_argtypes(optimizer_lattice(interp), given_argtypes, mi)
788+
argtypes_refined = Bool[!(optimizer_lattice(interp), ir.argtypes[i], given_argtypes[i])
789+
for i = 1:length(given_argtypes)]
790+
else
791+
argtypes_refined = Bool[false for i = 1:length(given_argtypes)]
792+
end
789793
empty!(ir.argtypes)
790794
append!(ir.argtypes, given_argtypes)
791795
tpdum = TwoPhaseDefUseMap(length(ir.stmts))

0 commit comments

Comments
 (0)