work around C backend bug

This commit is contained in:
Andrew Kelley 2024-10-10 21:02:53 -07:00
parent 05157e820a
commit 38458c6f70

View File

@ -3337,7 +3337,8 @@ fn sortPhdrs(
entry.* = .{ .phndx = @intCast(phndx) };
}
mem.sort(Entry, entries, phdrs.items, Entry.lessThan);
// The `@as` here works around a bug in the C backend.
mem.sort(Entry, entries, @as([]const elf.Elf64_Phdr, phdrs.items), Entry.lessThan);
const backlinks = try gpa.alloc(u16, entries.len);
defer gpa.free(backlinks);