@@ -1196,13 +1196,14 @@ function semi_concrete_eval_call(interp::AbstractInterpreter,
11961196 # state = InliningState(interp)
11971197 # ir = ssa_inlining_pass!(irsv.ir, state, propagate_inbounds(irsv))
11981198 effects = result. effects
1199- if ! is_nothrow (effects)
1200- effects = Effects (effects; nothrow)
1199+ if nothrow
1200+ effects = Effects (effects; nothrow= true )
12011201 end
12021202 if noub
1203- effects = Effects (effects; noub = ALWAYS_TRUE)
1203+ effects = Effects (effects; noub= ALWAYS_TRUE)
12041204 end
1205- return ConstCallResults (rt, result. exct, SemiConcreteResult (mi, ir, effects), effects, mi)
1205+ exct = refine_exception_type (result. exct, effects)
1206+ return ConstCallResults (rt, exct, SemiConcreteResult (mi, ir, effects), effects, mi)
12061207 end
12071208 end
12081209 end
@@ -2136,7 +2137,7 @@ function abstract_call_known(interp::AbstractInterpreter, @nospecialize(f),
21362137 argtypes = Any[typeof (< :), argtypes[3 ], argtypes[2 ]]
21372138 return abstract_call_known (interp, < :, ArgInfo (fargs, argtypes), si, sv, max_methods)
21382139 elseif la == 2 && istopfunction (f, :typename )
2139- return CallMeta (typename_static (argtypes[2 ]), Any , EFFECTS_TOTAL, MethodResultPure ())
2140+ return CallMeta (typename_static (argtypes[2 ]), Bottom , EFFECTS_TOTAL, MethodResultPure ())
21402141 elseif f === Core. _hasmethod
21412142 return _hasmethod_tfunc (interp, argtypes, sv)
21422143 end
@@ -3086,6 +3087,14 @@ function propagate_to_error_handler!(frame::InferenceState, currpc::Int, W::BitS
30863087 end
30873088end
30883089
3090+ function update_cycle_worklists! (callback, frame:: InferenceState )
3091+ for (caller, caller_pc) in frame. cycle_backedges
3092+ if callback (caller, caller_pc)
3093+ push! (caller. ip, block_for_inst (caller. cfg, caller_pc))
3094+ end
3095+ end
3096+ end
3097+
30893098# make as much progress on `frame` as possible (without handling cycles)
30903099function typeinf_local (interp:: AbstractInterpreter , frame:: InferenceState )
30913100 @assert ! is_inferred (frame)
@@ -3204,11 +3213,9 @@ function typeinf_local(interp::AbstractInterpreter, frame::InferenceState)
32043213 elseif isa (stmt, ReturnNode)
32053214 rt = abstract_eval_value (interp, stmt. val, currstate, frame)
32063215 if update_bestguess! (interp, frame, currstate, rt)
3207- for (caller, caller_pc) in frame. cycle_backedges
3208- if caller. ssavaluetypes[caller_pc] != = Any
3209- # no reason to revisit if that call-site doesn't affect the final result
3210- push! (caller. ip, block_for_inst (caller. cfg, caller_pc))
3211- end
3216+ update_cycle_worklists! (frame) do caller:: InferenceState , caller_pc:: Int
3217+ # no reason to revisit if that call-site doesn't affect the final result
3218+ return caller. ssavaluetypes[caller_pc] != = Any
32123219 end
32133220 end
32143221 ssavaluetypes[frame. currpc] = Any
@@ -3231,11 +3238,11 @@ function typeinf_local(interp::AbstractInterpreter, frame::InferenceState)
32313238 if cur_hand == 0
32323239 if ! ⊑ (𝕃ₚ, exct, frame. exc_bestguess)
32333240 frame. exc_bestguess = tmerge (𝕃ₚ, frame. exc_bestguess, exct)
3234- for ( caller, caller_pc) in frame . cycle_backedges
3235- handler = caller. handler_at[caller_pc][1 ]
3236- if (handler == 0 ? caller . exc_bestguess : caller . handlers[handler] . exct) != = Any
3237- push! ( caller. ip, block_for_inst ( caller. cfg, caller_pc))
3238- end
3241+ update_cycle_worklists! (frame) do caller:: InferenceState , caller_pc:: Int
3242+ caller_handler = caller. handler_at[caller_pc][1 ]
3243+ caller_exct = caller_handler == 0 ?
3244+ caller. exc_bestguess : caller. handlers[caller_handler] . exct
3245+ return caller_exct != = Any
32393246 end
32403247 end
32413248 else
0 commit comments