aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug.zig
diff options
context:
space:
mode:
authorJonathan Marler <johnnymarler@gmail.com>2020-11-25 13:23:43 -0700
committerAndrew Kelley <andrew@ziglang.org>2020-11-29 10:36:02 -0800
commit48660371a2f66b3859831abb276180c557a12f93 (patch)
treee1342698d7e8464197759c0103731a377b953484 /lib/std/debug.zig
parente701ac1a51e6f1d39b698b9b258c349b902dd848 (diff)
downloadzig-48660371a2f66b3859831abb276180c557a12f93.tar.gz
zig-48660371a2f66b3859831abb276180c557a12f93.zip
std.meta: add assumeSentinel
Diffstat (limited to 'lib/std/debug.zig')
-rw-r--r--lib/std/debug.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig
index 6850bb0ae5..0f1a1e8ae1 100644
--- a/lib/std/debug.zig
+++ b/lib/std/debug.zig
@@ -743,7 +743,7 @@ fn readCoffDebugInfo(allocator: *mem.Allocator, coff_file: File) !ModuleDebugInf
for (present) |_| {
const name_offset = try pdb_stream.inStream().readIntLittle(u32);
const name_index = try pdb_stream.inStream().readIntLittle(u32);
- const name = mem.spanZ(@ptrCast([*:0]u8, name_bytes.ptr + name_offset));
+ const name = mem.spanZ(std.meta.assumeSentinel(name_bytes.ptr + name_offset, 0));
if (mem.eql(u8, name, "/names")) {
break :str_tab_index name_index;
}
@@ -891,7 +891,7 @@ pub fn readElfDebugInfo(allocator: *mem.Allocator, elf_file: File) !ModuleDebugI
for (shdrs) |*shdr| {
if (shdr.sh_type == elf.SHT_NULL) continue;
- const name = std.mem.span(@ptrCast([*:0]const u8, header_strings[shdr.sh_name..].ptr));
+ const name = std.mem.span(std.meta.assumeSentinel(header_strings[shdr.sh_name..].ptr, 0));
if (mem.eql(u8, name, ".debug_info")) {
opt_debug_info = try chopSlice(mapped_mem, shdr.sh_offset, shdr.sh_size);
} else if (mem.eql(u8, name, ".debug_abbrev")) {