From b4ed757e6091e7918a1e4194365ed95060d32a0c Mon Sep 17 00:00:00 2001 From: Simeon David Schaub Date: Sat, 28 Sep 2024 15:17:22 +0200 Subject: [PATCH] adapt to linetable changes in Julia nightly fixes #126 --- src/Infiltrator.jl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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