Commit d8469e3c7c

Jimmi Holst Christensen <rainbowhejsil@gmail.com>
2018-01-19 22:08:44
usize might be same size as LARGE_INTEGER. If that's the case, then we don't want to compare pos to @maxValue(usize).
1 parent a1a69f2
Changed files (1)
std
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);