Skip to content

Commit

Permalink
fix: swift bind lookups
Browse files Browse the repository at this point in the history
  • Loading branch information
blacktop committed Apr 20, 2024
1 parent e671c95 commit b62c0bb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions swift.go
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,13 @@ func (f *File) readProtocolConformance(r io.ReadSeeker, addr uint64) (pcd *swift
paddr = f.vma.Convert(paddr)
if paddr == 0 {
pcd.Protocol = "<stripped>"
paddr = pcd.ProtocolOffsest.GetRelPtrAddress()
if (paddr & 1) == 1 {
paddr = paddr &^ 1
}
if bind, err := f.GetBindName(paddr); err == nil {
pcd.Protocol = bind
}
} else if bind, err := f.GetBindName(paddr); err == nil {
pcd.Protocol = bind
} else {
Expand Down Expand Up @@ -1382,6 +1389,13 @@ func (f *File) readProtocolConformance(r io.ReadSeeker, addr uint64) (pcd *swift
}
if addr == 0 {
pcd.ResilientWitnesses[idx].Symbol = "<stripped>"
addr = wit.RequirementOff.GetRelPtrAddress()
if (addr & 1) == 1 {
addr = addr &^ 1
}
if bind, err := f.GetBindName(addr); err == nil {
pcd.ResilientWitnesses[idx].Symbol = bind
}
} else {
if bind, err := f.GetBindName(addr); err == nil {
pcd.ResilientWitnesses[idx].Symbol = bind
Expand Down

0 comments on commit b62c0bb

Please sign in to comment.