Skip to content

Commit 9cc6cf0

Browse files
authored
Merge pull request #489 from JuliaDebug/avi/fix488
fix #488, update to JuliaLang/julia#41137
2 parents 407fa70 + aafa433 commit 9cc6cf0

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/interpret.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,12 @@ function evaluate_methoddef(frame, node)
276276
length(node.args) == 1 && return f
277277
sig = @lookup(frame, node.args[2])::SimpleVector
278278
body = @lookup(frame, node.args[3])
279-
ccall(:jl_method_def, Cvoid, (Any, Any, Any), sig, body, moduleof(frame))
279+
# branching on https://github.com/JuliaLang/julia/pull/41137
280+
@static if isdefined(Core.Compiler, :OverlayMethodTable)
281+
ccall(:jl_method_def, Cvoid, (Any, Ptr{Cvoid}, Any, Any), sig, C_NULL, body, moduleof(frame))
282+
else
283+
ccall(:jl_method_def, Cvoid, (Any, Any, Any), sig, body, moduleof(frame))
284+
end
280285
return f
281286
end
282287

test/interpret.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,3 +804,10 @@ end
804804
# even after https://github.com/JuliaLang/julia/pull/41018
805805
@test Int === @interpret Core.Compiler.getfield_tfunc(m.Foo, Core.Compiler.Const(:foo))
806806
end
807+
808+
@testset "https://github.com/JuliaDebug/JuliaInterpreter.jl/issues/488" begin
809+
m = Module()
810+
ex = :(foo() = return)
811+
JuliaInterpreter.finish_and_return!(Frame(m, ex), true)
812+
@test isdefined(m, :foo)
813+
end

0 commit comments

Comments
 (0)