From ad9d13c6719e9f5e2a68a6f9078860ba75add146 Mon Sep 17 00:00:00 2001 From: chainhelen Date: Mon, 13 Apr 2020 16:24:04 -0500 Subject: [PATCH] proc: Don't set fileFound if there's a compileUnit without line section (#2006) We should not return error directly which set `fileFound` to be true if there's a compileUnit without line section. --- pkg/proc/bininfo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/proc/bininfo.go b/pkg/proc/bininfo.go index 05196c9a..d4b8d3ab 100644 --- a/pkg/proc/bininfo.go +++ b/pkg/proc/bininfo.go @@ -521,7 +521,7 @@ func (bi *BinaryInfo) LineToPC(filename string, lineno int) (pcs []uint64, err e fileFound := false var pc uint64 for _, cu := range bi.compileUnits { - if cu.lineInfo != nil && cu.lineInfo.Lookup[filename] == nil { + if cu.lineInfo == nil || cu.lineInfo.Lookup[filename] == nil { continue } fileFound = true