Skip to content

Commit fe6171b

Browse files
authored
allow src.slottypes === nothing for unoptimized src (#445)
On nightly Cthulhu.jl tries to generate `src.slottypes::Vector{Any}` even when there is heavy recursion detected (xref #418), but it turns out that `record_slot_assign!(sv)` works only when `sv.ssavaluetypes` does not contain any `LimitedAccuracy`ies (#442). Luckily, while working on #418, we added the support in TypedSyntax for the `src.slottypes === nothing` case, so we can use it and remove the code to generate `src.slottypes::Vector{Any}` Fixes #442.
1 parent d6381ab commit fe6171b

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

src/interpreter.jl

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -135,24 +135,9 @@ function CC.type_annotate!(interp::CthulhuInterpreter, sv::InferenceState, run_o
135135
end
136136
end
137137

138-
function annotate_slottypes!(sv::InferenceState)
139-
slottypes = sv.slottypes
140-
for i = 1:length(slottypes)
141-
slottypes[i] = CC.widenconditional(slottypes[i])
142-
end
143-
CC.record_slot_assign!(sv)
144-
return sv.src.slottypes
145-
end
146-
147138
function InferredSource(state::InferenceState)
148139
unoptsrc = copy(state.src)
149-
@static if VERSION v"1.10.0-DEV.1033"
150-
if unoptsrc.slottypes === nothing
151-
# `slottypes::Vector{Any}` hasn't been generated due to recursion,
152-
# so manually generate it here
153-
unoptsrc.slottypes = annotate_slottypes!(state)
154-
end
155-
else
140+
@static if VERSION < v"1.10.0-DEV.1033"
156141
# xref: https://github.com/JuliaLang/julia/pull/49378
157142
unoptsrc.slottypes = let slottypes = unoptsrc.slottypes
158143
slottypes === nothing ? nothing : copy(slottypes)

0 commit comments

Comments
 (0)