@@ -208,6 +208,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(fun
208208 end
209209 if const_edge != = nothing
210210 edge = const_edge
211+ update_valid_age! (sv, world_range (const_edge))
211212 end
212213 end
213214
@@ -2330,6 +2331,7 @@ function abstract_invoke(interp::AbstractInterpreter, arginfo::ArgInfo, si::Stmt
23302331 end
23312332 if const_edge != = nothing
23322333 edge = const_edge
2334+ update_valid_age! (sv, world_range (const_edge))
23332335 end
23342336 end
23352337 rt = from_interprocedural! (interp, rt, sv, arginfo′, sig)
@@ -2396,8 +2398,9 @@ function abstract_eval_getglobal(interp::AbstractInterpreter, sv::AbsIntState, s
23962398 if M isa Const && s isa Const
23972399 M, s = M. val, s. val
23982400 if M isa Module && s isa Symbol
2399- (ret, bpart) = abstract_eval_globalref (interp, GlobalRef (M, s), saw_latestworld, sv)
2400- return CallMeta (ret, bpart === nothing ? NoCallInfo () : GlobalAccessInfo (bpart))
2401+ gr = GlobalRef (M, s)
2402+ (ret, bpart) = abstract_eval_globalref (interp, gr, saw_latestworld, sv)
2403+ return CallMeta (ret, bpart === nothing ? NoCallInfo () : GlobalAccessInfo (convert (Core. Binding, gr), bpart))
24012404 end
24022405 return CallMeta (Union{}, TypeError, EFFECTS_THROWS, NoCallInfo ())
24032406 elseif ! hasintersect (widenconst (M), Module) || ! hasintersect (widenconst (s), Symbol)
@@ -2475,8 +2478,9 @@ function abstract_eval_setglobal!(interp::AbstractInterpreter, sv::AbsIntState,
24752478 if isa (M, Const) && isa (s, Const)
24762479 M, s = M. val, s. val
24772480 if M isa Module && s isa Symbol
2478- (rt, exct), partition = global_assignment_rt_exct (interp, sv, saw_latestworld, GlobalRef (M, s), v)
2479- return CallMeta (rt, exct, Effects (setglobal!_effects, nothrow= exct=== Bottom), GlobalAccessInfo (partition))
2481+ gr = GlobalRef (M, s)
2482+ (rt, exct), partition = global_assignment_rt_exct (interp, sv, saw_latestworld, gr, v)
2483+ return CallMeta (rt, exct, Effects (setglobal!_effects, nothrow= exct=== Bottom), GlobalAccessInfo (convert (Core. Binding, gr), partition))
24802484 end
24812485 return CallMeta (Union{}, TypeError, EFFECTS_THROWS, NoCallInfo ())
24822486 end
@@ -2564,14 +2568,15 @@ function abstract_eval_replaceglobal!(interp::AbstractInterpreter, sv::AbsIntSta
25642568 M, s = M. val, s. val
25652569 M isa Module || return CallMeta (Union{}, TypeError, EFFECTS_THROWS, NoCallInfo ())
25662570 s isa Symbol || return CallMeta (Union{}, TypeError, EFFECTS_THROWS, NoCallInfo ())
2567- partition = abstract_eval_binding_partition! (interp, GlobalRef (M, s), sv)
2571+ gr = GlobalRef (M, s)
2572+ partition = abstract_eval_binding_partition! (interp, gr, sv)
25682573 rte = abstract_eval_partition_load (interp, partition)
25692574 if binding_kind (partition) == BINDING_KIND_GLOBAL
25702575 T = partition_restriction (partition)
25712576 end
25722577 exct = Union{rte. exct, global_assignment_binding_rt_exct (interp, partition, v)[2 ]}
25732578 effects = merge_effects (rte. effects, Effects (setglobal!_effects, nothrow= exct=== Bottom))
2574- sg = CallMeta (Any, exct, effects, GlobalAccessInfo (partition))
2579+ sg = CallMeta (Any, exct, effects, GlobalAccessInfo (convert (Core . Binding, gr), partition))
25752580 else
25762581 sg = abstract_eval_setglobal! (interp, sv, saw_latestworld, M, s, v)
25772582 end
@@ -2791,6 +2796,7 @@ function abstract_call_opaque_closure(interp::AbstractInterpreter,
27912796 end
27922797 if const_edge != = nothing
27932798 edge = const_edge
2799+ update_valid_age! (sv, world_range (const_edge))
27942800 end
27952801 end
27962802 end
@@ -3225,7 +3231,8 @@ function abstract_eval_isdefinedglobal(interp::AbstractInterpreter, mod::Module,
32253231 end
32263232
32273233 effects = EFFECTS_TOTAL
3228- partition = lookup_binding_partition! (interp, GlobalRef (mod, sym), sv)
3234+ gr = GlobalRef (mod, sym)
3235+ partition = lookup_binding_partition! (interp, gr, sv)
32293236 if allow_import != = true && is_some_imported (binding_kind (partition))
32303237 if allow_import === false
32313238 rt = Const (false )
@@ -3243,7 +3250,7 @@ function abstract_eval_isdefinedglobal(interp::AbstractInterpreter, mod::Module,
32433250 effects = Effects (generic_isdefinedglobal_effects, nothrow= true )
32443251 end
32453252 end
3246- return CallMeta (RTEffects (rt, Union{}, effects), GlobalAccessInfo (partition))
3253+ return CallMeta (RTEffects (rt, Union{}, effects), GlobalAccessInfo (convert (Core . Binding, gr), partition))
32473254end
32483255
32493256function abstract_eval_isdefinedglobal (interp:: AbstractInterpreter , @nospecialize (M), @nospecialize (s), @nospecialize (allow_import_arg), @nospecialize (order_arg), saw_latestworld:: Bool , sv:: AbsIntState )
@@ -3454,6 +3461,7 @@ end
34543461
34553462world_range (ir:: IRCode ) = ir. valid_worlds
34563463world_range (ci:: CodeInfo ) = WorldRange (ci. min_world, ci. max_world)
3464+ world_range (ci:: CodeInstance ) = WorldRange (ci. min_world, ci. max_world)
34573465world_range (compact:: IncrementalCompact ) = world_range (compact. ir)
34583466
34593467function force_binding_resolution! (g:: GlobalRef , world:: UInt )
0 commit comments