Skip to content

Commit d4ae7fa

Browse files
committed
Since JuliaLang/julia#59915, `Base._which` now takes `Compiler.MethodTableView` instead of `MethodTable`, so this change is necessary. However, with this change, it seems that CassetteOverlay and external abstract interpreter packages cannot be composed. If this becomes necessary, we may need to change the interface of `CassetteOverlay.method_table`.
1 parent 3accdb9 commit d4ae7fa

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "CassetteOverlay"
22
uuid = "d78b62d4-37fa-4a6f-acd8-2f19986eb9ee"
3-
authors = ["JuliaHub, Inc. and other contributors"]
43
version = "0.2.3"
4+
authors = ["JuliaHub, Inc. and other contributors"]
55

66
[deps]
77
CassetteBase = "6dd3e646-b1c5-42c7-94be-00277fa12e22"

src/CassetteOverlay.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ macro overlaypass(args...)
9292
nonoverlaytype = typeof(CassetteOverlay.nonoverlay)
9393

9494
if method_table !== :nothing
95-
mthd_tbl = :($CassetteOverlay.methodtable(::UInt, ::Type{$PassName}) = $(esc(method_table)))
95+
mthd_tbl = :($CassetteOverlay.methodtable(world::UInt, ::Type{$PassName}) =
96+
Base.Compiler.OverlayMethodTable(world, $(esc(method_table))))
9697
else
9798
mthd_tbl = nothing
9899
end
@@ -175,12 +176,12 @@ function methodtable(world::UInt, ::Type{<:AbstractBindingOverlay{M, S}}) where
175176
end
176177
@static if VERSION v"1.12-"
177178
@assert isconst_at_world(M, S, world)
178-
mt = getglobal_at_world(M, S, world)
179+
mt = getglobal_at_world(M, S, world)::MethodTable
180+
return Base.Compiler.OverlayMethodTable(world, mt)
179181
else
180182
@assert @invokelatest isconst(M, S)
181-
mt = getglobal(M, S)
183+
return getglobal(M, S)::MethodTable
182184
end
183-
return mt::MethodTable
184185
end
185186
@overlaypass AbstractBindingOverlay nothing
186187

0 commit comments

Comments
 (0)