Skip to content

Commit

Permalink
perfsession: sort dwarfLineTable
Browse files Browse the repository at this point in the history
findIP assumes that s.linetab is sorted, but dwarfLineTable doesn't
currently guarantee that.
  • Loading branch information
prattmic authored and aclements committed Mar 3, 2023
1 parent cadabe6 commit 7b712e5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions perfsession/symbolize.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,5 +407,10 @@ func dwarfLineTable(dwarff *dwarf.Data) []dwarf.LineEntry {
out = append(out, lent)
}
}

sort.Slice(out, func(i, j int) bool {
return out[i].Address < out[j].Address
})

return out
}

0 comments on commit 7b712e5

Please sign in to comment.