mirror of
https://github.com/ziglang/zig.git
synced 2024-11-28 16:12:33 +00:00
usize might be same size as LARGE_INTEGER. If that's the case, then we don't want to compare pos to @maxValue(usize).
This commit is contained in:
parent
a1a69f24c8
commit
d8469e3c7c
@ -277,8 +277,10 @@ pub const File = struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
assert(pos >= 0);
|
assert(pos >= 0);
|
||||||
if (pos > @maxValue(usize)) {
|
if (@sizeOf(@typeOf(pos)) > @sizeOf(usize)) {
|
||||||
return error.FilePosLargerThanPointerRange;
|
if (pos > @maxValue(usize)) {
|
||||||
|
return error.FilePosLargerThanPointerRange;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return usize(pos);
|
return usize(pos);
|
||||||
|
Loading…
Reference in New Issue
Block a user