From faf2fd18d33de246c5bb03905f25290108e1dd30 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Sun, 22 Jan 2023 17:34:38 +0100 Subject: std: eliminate pointless meta.assumeSentinel() usage This fixes a bug in std.net caused during the introduction of meta.assumeSentinel due to the unfortunate semantics of mem.span() This leaves only 3 remaining uses of meta.assumeSentinel() in the standard library, each of which could be a simple @ptrCast([*:0]T, foo) instead. I think this function should likely be removed. --- lib/std/pdb.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/std/pdb.zig') diff --git a/lib/std/pdb.zig b/lib/std/pdb.zig index ab712e2aff..287b65b59d 100644 --- a/lib/std/pdb.zig +++ b/lib/std/pdb.zig @@ -671,7 +671,7 @@ pub const Pdb = struct { const name_index = try reader.readIntLittle(u32); if (name_offset > name_bytes.len) return error.InvalidDebugInfo; - const name = mem.sliceTo(std.meta.assumeSentinel(name_bytes.ptr + name_offset, 0), 0); + const name = mem.sliceTo(name_bytes[name_offset..], 0); if (mem.eql(u8, name, "/names")) { break :str_tab_index name_index; } -- cgit v1.2.3