-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LoweredCodeUtils does not compose with CassetteOverlay #80
Comments
Here's why this happens: typically there's a "registration" of the julia> Meta.lower(Main, :(f() = nothing))
:($(Expr(:thunk, CodeInfo(
@ none within `top-level scope`
1 ─ $(Expr(:thunk, CodeInfo(
@ none within `top-level scope`
1 ─ return $(Expr(:method, :f))
)))
│ $(Expr(:method, :f))
│ %3 = Core.Typeof(f)
│ %4 = Core.svec(%3)
│ %5 = Core.svec()
│ %6 = Core.svec(%4, %5, $(QuoteNode(:(#= REPL[1]:1 =#))))
│ $(Expr(:method, :f, :(%6), CodeInfo(
@ REPL[1]:1 within `none`
1 ─ return nothing
)))
└── return f
)))) But julia> Meta.lower(Main, :(Base.Experimental.@overlay SomeMT f() = nothing))
:($(Expr(:thunk, CodeInfo(
@ none within `top-level scope`
1 ─ %1 = Core.Typeof(f)
│ %2 = Core.svec(%1)
│ %3 = Core.svec()
│ %4 = Core.svec(%2, %3, $(QuoteNode(:(#= REPL[4]:1 =#))))
│ $(Expr(:method, :SomeMT, :(%4), CodeInfo(
@ REPL[4]:1 within `none`
1 ─ return nothing
)))
└── return nothing
)))) I wonder if the actual bug is in |
There isn't a full reproducer here, but one option might be to try this diff: $ git diff
diff --git a/src/signatures.jl b/src/signatures.jl
index 4ae33d5..3318b75 100644
--- a/src/signatures.jl
+++ b/src/signatures.jl
@@ -165,7 +165,7 @@ function identify_framemethod_calls(frame)
key = stmt.args[1]
key = normalize_defsig(key, frame)
if key isa Symbol
- mi = methodinfos[key]
+ mi = get(methodinfos, key, MethodInfo(1))
mi.stop = i
elseif key isa Expr # this is a module-scoped call. We don't have to worry about these because they are named
continue and see how far that gets you. |
In the variant of https://github.com/JuliaLang/julia/blob/master/src/interpreter.c#L100-L112 |
That's essentially what this package is doing, too: LoweredCodeUtils.jl/src/signatures.jl Lines 154 to 172 in ef12495
But it expects to see a 1-arg If you can provide a recipe for reproducing it, I can fix it. |
while trying to use revise.
The text was updated successfully, but these errors were encountered: