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.
This commit is contained in:
chainhelen
2020-04-13 16:24:04 -05:00
committed by GitHub
parent c534677ece
commit ad9d13c671

View File

@ -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