From d8469e3c7ce9c0627aba65075ae85b98d2b60cbc Mon Sep 17 00:00:00 2001 From: Jimmi Holst Christensen Date: Fri, 19 Jan 2018 22:08:44 +0100 Subject: [PATCH] usize might be same size as LARGE_INTEGER. If that's the case, then we don't want to compare pos to @maxValue(usize). --- std/io.zig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/std/io.zig b/std/io.zig index 2d20e17168..cfde7c6013 100644 --- a/std/io.zig +++ b/std/io.zig @@ -277,8 +277,10 @@ pub const File = struct { } assert(pos >= 0); - if (pos > @maxValue(usize)) { - return error.FilePosLargerThanPointerRange; + if (@sizeOf(@typeOf(pos)) > @sizeOf(usize)) { + if (pos > @maxValue(usize)) { + return error.FilePosLargerThanPointerRange; + } } return usize(pos);