From 403a46abccbc03e70e7975d00a5134867a1d4fc7 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 10 Nov 2017 16:03:14 -0500 Subject: [PATCH] fix test failure on 32 bit windows --- std/io.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/std/io.zig b/std/io.zig index 64946b28b4..d570927488 100644 --- a/std/io.zig +++ b/std/io.zig @@ -273,7 +273,9 @@ pub const File = struct { else => os.unexpectedErrorWindows(err), }; } - return @bitCast(usize, file_size); + if (file_size < 0) + return error.Overflow; + return math.cast(usize, u64(file_size)); } else { unreachable; }