| ... | ... | @@ -68,7 +68,13 @@ pub fn generate(info: *UnwindInfo, macho_file: *MachO) !void { |
| 68 | 68 | for (info.records.items) |ref| { |
| 69 | 69 | const rec = ref.getUnwindRecord(macho_file); |
| 70 | 70 | if (rec.getFde(macho_file)) |fde| { |
| 71 | | rec.enc.setDwarfSectionOffset(@intCast(fde.out_offset)); |
| 71 | // The unwinder will start looking for a matching CFI at the offset we specify here; it |
| 72 | // isn't actually an offset to the exact CFI for this record. A consequence of this is |
| 73 | // that if the offset doesn't fit in 24 bits, we can just leave it as zero so the |
| 74 | // unwinder starts searching at the beginning of the section. |
| 75 | if (std.math.cast(u24, fde.out_offset)) |off| { |
| 76 | rec.enc.setDwarfSectionOffset(off); |
| 77 | } |
| 72 | 78 | if (fde.getLsdaAtom(macho_file)) |lsda| { |
| 73 | 79 | rec.lsda = lsda.atom_index; |
| 74 | 80 | rec.lsda_offset = fde.lsda_offset; |