Skip to content

Commit b62c0bb

Browse files
committed
fix: swift bind lookups
1 parent e671c95 commit b62c0bb

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

swift.go

+14
Original file line numberDiff line numberDiff line change
@@ -1224,6 +1224,13 @@ func (f *File) readProtocolConformance(r io.ReadSeeker, addr uint64) (pcd *swift
12241224
paddr = f.vma.Convert(paddr)
12251225
if paddr == 0 {
12261226
pcd.Protocol = "<stripped>"
1227+
paddr = pcd.ProtocolOffsest.GetRelPtrAddress()
1228+
if (paddr & 1) == 1 {
1229+
paddr = paddr &^ 1
1230+
}
1231+
if bind, err := f.GetBindName(paddr); err == nil {
1232+
pcd.Protocol = bind
1233+
}
12271234
} else if bind, err := f.GetBindName(paddr); err == nil {
12281235
pcd.Protocol = bind
12291236
} else {
@@ -1382,6 +1389,13 @@ func (f *File) readProtocolConformance(r io.ReadSeeker, addr uint64) (pcd *swift
13821389
}
13831390
if addr == 0 {
13841391
pcd.ResilientWitnesses[idx].Symbol = "<stripped>"
1392+
addr = wit.RequirementOff.GetRelPtrAddress()
1393+
if (addr & 1) == 1 {
1394+
addr = addr &^ 1
1395+
}
1396+
if bind, err := f.GetBindName(addr); err == nil {
1397+
pcd.ResilientWitnesses[idx].Symbol = bind
1398+
}
13851399
} else {
13861400
if bind, err := f.GetBindName(addr); err == nil {
13871401
pcd.ResilientWitnesses[idx].Symbol = bind

0 commit comments

Comments
 (0)