Skip to content

Commit ae55fb2

Browse files
authored
ignore module_infer flag when generating a system image (#43423)
1 parent a3c2798 commit ae55fb2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

base/compiler/typeinfer.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,8 @@ function resolve_call_cycle!(interp::AbstractInterpreter, linfo::MethodInstance,
768768
return false
769769
end
770770

771+
generating_sysimg() = ccall(:jl_generating_output, Cint, ()) != 0 && JLOptions().incremental == 0
772+
771773
# compute (and cache) an inferred AST and return the current best estimate of the result type
772774
function typeinf_edge(interp::AbstractInterpreter, method::Method, @nospecialize(atype), sparams::SimpleVector, caller::InferenceState)
773775
mi = specialize_method(method, atype, sparams)::MethodInstance
@@ -800,7 +802,7 @@ function typeinf_edge(interp::AbstractInterpreter, method::Method, @nospecialize
800802
else
801803
cache = :global # cache edge targets by default
802804
end
803-
if ccall(:jl_get_module_infer, Cint, (Any,), method.module) == 0
805+
if ccall(:jl_get_module_infer, Cint, (Any,), method.module) == 0 && !generating_sysimg()
804806
return Any, nothing
805807
end
806808
if !caller.cached && caller.parent === nothing
@@ -898,7 +900,7 @@ function typeinf_ext(interp::AbstractInterpreter, mi::MethodInstance)
898900
end
899901
end
900902
end
901-
if ccall(:jl_get_module_infer, Cint, (Any,), method.module) == 0
903+
if ccall(:jl_get_module_infer, Cint, (Any,), method.module) == 0 && !generating_sysimg()
902904
return retrieve_code_info(mi)
903905
end
904906
lock_mi_inference(interp, mi)

0 commit comments

Comments
 (0)