Skip to content

Commit

Permalink
fix: LoadAbstractOriginAndSpecification infinite loop caused by abstr…
Browse files Browse the repository at this point in the history
…act origin point to itself. (#3767)
  • Loading branch information
zdyj3170101136 committed Jul 8, 2024
1 parent 979e487 commit 8e9607a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/dwarf/godwarf/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (ce compositeEntry) AttrField(a dwarf.Attr) *dwarf.Field {
// DWARF standard is unclear on how this should be handled
func LoadAbstractOriginAndSpecification(entry *dwarf.Entry, aordr *dwarf.Reader) (Entry, dwarf.Offset) {
ao, ok := getAbstractOriginOrSpecification(entry)
if !ok {
if !ok || ao == entry.Offset {
return entry, entry.Offset
}

Expand All @@ -55,7 +55,7 @@ func LoadAbstractOriginAndSpecification(entry *dwarf.Entry, aordr *dwarf.Reader)
r = append(r, e)

ao, ok = getAbstractOriginOrSpecification(e)
if !ok {
if !ok || ao == entry.Offset {
break
}
}
Expand Down

0 comments on commit 8e9607a

Please sign in to comment.