Skip to content

Commit

Permalink
Fix MethodInstance multiplicity
Browse files Browse the repository at this point in the history
Formerly this seemed to return a single MethodInstance, but now it
returns two. The change is may be from improvements to MethodAnalysis,
likely timholy/MethodAnalysis.jl#27.
The new behavior is certainly the correct one (there are two distinct
methods, so there had better be two MethodInstances with that
signature---even though one will never get another CodeInstance).
  • Loading branch information
timholy committed Feb 15, 2022
1 parent 232f2f7 commit de63569
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/snoopi_deep.jl
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,8 @@ end
# we get mt_backedges with a MethodInstance middle entry too
strees2 = precompile_blockers(invalidations, tinf; min_world_exclude=0)
sig, root, hits = only(only(strees2).mt_backedges)
@test sig == methodinstance(StaleA.stale, (String,))
mi_stale = only(filter(mi -> endswith(String(mi.def.file), "StaleA.jl"), methodinstances(StaleA.stale, (String,))))
@test sig == mi_stale
@test root == Core.MethodInstance(only(hits)) == methodinstance(StaleB.useA, ())
# What happens when we can't find it in the tree?
idx = findfirst(isequal("jl_method_table_insert"), invalidations)
Expand Down

0 comments on commit de63569

Please sign in to comment.