Skip to content

Commit 6a26615

Browse files
committed
update branch for latest std.sort changes
1 parent 48cc2a7 commit 6a26615

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

lib/std/Build/Fuzz/WebServer.zig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,11 @@ fn addEntryPoint(ws: *WebServer, coverage_id: u64, addr: u64) error{ AlreadyRepo
649649
const ptr = coverage_map.mapped_memory;
650650
const pcs_bytes = ptr[@sizeOf(abi.SeenPcsHeader)..][0 .. coverage_map.source_locations.len * @sizeOf(usize)];
651651
const pcs: []const usize = @alignCast(std.mem.bytesAsSlice(usize, pcs_bytes));
652-
const index = std.sort.upperBound(usize, addr, pcs, {}, std.sort.asc(usize));
652+
const index = std.sort.upperBound(usize, pcs, addr, struct {
653+
fn order(context: usize, item: usize) std.math.Order {
654+
return std.math.order(item, context);
655+
}
656+
}.order);
653657
if (index >= pcs.len) {
654658
log.err("unable to find unit test entry address 0x{x} in source locations (range: 0x{x} to 0x{x})", .{
655659
addr, pcs[0], pcs[pcs.len - 1],

lib/std/debug/Dwarf.zig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,11 @@ pub const CompileUnit = struct {
157157
};
158158

159159
pub fn findSource(slc: *const SrcLocCache, address: u64) !LineEntry {
160-
const index = std.sort.upperBound(u64, address, slc.line_table.keys(), {}, std.sort.asc(u64));
160+
const index = std.sort.upperBound(u64, slc.line_table.keys(), address, struct {
161+
fn order(context: u64, item: u64) std.math.Order {
162+
return std.math.order(item, context);
163+
}
164+
}.order);
161165
if (index == 0) return missing();
162166
return slc.line_table.values()[index - 1];
163167
}

0 commit comments

Comments
 (0)