Skip to content

Commit

Permalink
Handle synthetic function detection where callee pkg is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrajz committed Dec 31, 2024
1 parent b9a36bd commit 69d077e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion output.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ import (
)

func isSynthetic(edge *callgraph.Edge) bool {
return edge.Caller.Func.Pkg == nil || edge.Callee.Func.Synthetic != ""
// TODO: consider handling callee.Func.Pkg == nil
// this could still generate a node for the call, might be useful
return edge.Caller.Func.Pkg == nil || edge.Callee.Func.Pkg == nil || edge.Callee.Func.Synthetic != ""
}

func inStd(node *callgraph.Node) bool {
Expand Down

0 comments on commit 69d077e

Please sign in to comment.