Skip to content

Commit

Permalink
Add another workaround for #184 (#187)
Browse files Browse the repository at this point in the history
See discussion in #185

Co-authored-by: Chris Rackauckas <[email protected]>
  • Loading branch information
timholy and ChrisRackauckas authored Aug 1, 2021
1 parent 18e558f commit 571a905
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/backedges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ specTypes(mi::MethodInstance) = mi.specTypes
instance(mi::MethodInstance) = mi
nextnode(mi, edge) = edge

instance(sfs::Vector{StackTraces.StackFrame}) = sfs[end].linfo
instance(sfs::Vector{StackTraces.StackFrame}) = isempty(sfs) ? Core.Compiler.Timings.ROOTmi : sfs[end].linfo
method(sfs::Vector{StackTraces.StackFrame}) = method(instance(sfs))

instance(ipframes::Vector{IPFrames}) = isempty(ipframes) ? nothing : instance(ipframes[1].sfs)
instance(ipframes::Vector{IPFrames}) = isempty(ipframes) ? Core.Compiler.Timings.ROOTmi : instance(ipframes[1].sfs)
backedges(ipframes::Vector{IPFrames}) = (ret = ipframes[2:end]; isempty(ret) ? () : (ret,))

function callstring(io, mi)
Expand Down
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ fst5(x) = fst4(x)
tree = Cthulhu.treelist(similar(fst5(1.0), 0))
@test isempty(tree.data.callstr)
@test isempty(Cthulhu.callstring(io, similar(stacktrace(fst5(1.0)), 0)))
@test Cthulhu.instance(similar(stacktrace(fst5(1.0)), 0)) === Core.Compiler.Timings.ROOTmi
end

@testset "ascend" begin
Expand Down

0 comments on commit 571a905

Please sign in to comment.