diff --git a/src/Infiltrator.jl b/src/Infiltrator.jl index 1c26075..e2dd9f8 100644 --- a/src/Infiltrator.jl +++ b/src/Infiltrator.jl @@ -882,11 +882,15 @@ function find_first_topelevel_scope(bt::Vector{<:Union{Base.InterpreterIP,Ptr{Cv ind = findfirst(st) do frame linfo = frame.linfo if linfo isa Core.CodeInfo - linetable = linfo.linetable - if isa(linetable, Vector) && length(linetable) ≥ 1 - lin = first(linetable) - if isa(lin, Core.LineInfoNode) && lin.method === StackTraces.top_level_scope_sym - return true + @static if hasfield(Core.CodeInfo, :debuginfo) + linfo.debuginfo.def === StackTraces.top_level_scope_sym && return true + else + linetable = linfo.linetable + if isa(linetable, Vector) && length(linetable) ≥ 1 + lin = first(linetable) + if isa(lin, Core.LineInfoNode) && lin.method === StackTraces.top_level_scope_sym + return true + end end end else