Skip to content

Commit ac18aed

Browse files
authored
Fix a Symbol/GlobalRef confusion on Julia 1.11 (#109)
Any method defined in-frame will be in the same module. We can check the type of the `global` arg to ensure it's a Symbol and not a GlobalRef.
1 parent e6a5e00 commit ac18aed

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "LoweredCodeUtils"
22
uuid = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b"
33
authors = ["Tim Holy <[email protected]>"]
4-
version = "2.4.7"
4+
version = "2.4.8"
55

66
[deps]
77
JuliaInterpreter = "aa1ae85d-cabe-5617-a682-6adf51b2e16a"

src/signatures.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,12 @@ function identify_framemethod_calls(frame)
146146
for (i, stmt) in enumerate(frame.framecode.src.code)
147147
isa(stmt, Expr) || continue
148148
if stmt.head === :global && length(stmt.args) == 1
149-
key = stmt.args[1]::Symbol
150-
# We don't know for sure if this is a reference to a method, but let's
151-
# tentatively cue it
152-
push!(refs, key=>i)
149+
key = stmt.args[1]
150+
if isa(key, Symbol)
151+
# We don't know for sure if this is a reference to a method, but let's
152+
# tentatively cue it
153+
push!(refs, key=>i)
154+
end
153155
elseif stmt.head === :thunk && stmt.args[1] isa CodeInfo
154156
tsrc = stmt.args[1]::CodeInfo
155157
if length(tsrc.code) == 1

0 commit comments

Comments
 (0)