From 77d04c03e3f20c4c60d98e73b876222006aa05fc Mon Sep 17 00:00:00 2001 From: Robin Voetter Date: Wed, 4 Sep 2019 16:23:25 +0200 Subject: Implement remaining requested changes - Replace @intCast with a checked version (std/debug.zig) - Replace @intCast with i64() when casting from a smaller type (std/fs/file.zig) - Replace `nakedcc` with appropriate calling convention for linking with c (std/os/linux/arm-eabi.zig) - Only check if hwcap contains TLS when the hwcap field actually exists (std/os/linux/tls.zig) --- std/debug.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'std/debug.zig') diff --git a/std/debug.zig b/std/debug.zig index 8918426e47..68e6220a72 100644 --- a/std/debug.zig +++ b/std/debug.zig @@ -1053,7 +1053,8 @@ fn openSelfDebugInfoPosix(allocator: *mem.Allocator) !DwarfInfo { S.self_exe_file = try fs.openSelfExe(); errdefer S.self_exe_file.close(); - const self_exe_mmap_len = mem.alignForward(@intCast(usize, try S.self_exe_file.getEndPos()), mem.page_size); + const self_exe_len = math.cast(usize, try S.self_exe_file.getEndPos()) catch return error.DebugInfoTooLarge; + const self_exe_mmap_len = mem.alignForward(self_exe_len, mem.page_size); const self_exe_mmap = try os.mmap( null, self_exe_mmap_len, -- cgit v1.2.3