| author | |
| committer | |
| log | d8469e3c7ce9c0627aba65075ae85b98d2b60cbc |
| tree | bb1d74fcd78f2b4305f43fb87f096df1619e473c |
| parent | a1a69f24c846fdd8a7682216c383df53963b5b3b |
1 files changed, 4 insertions(+), 2 deletions(-)
std/io.zig+4-2| ... | ... | @@ -277,8 +277,10 @@ pub const File = struct { |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | assert(pos >= 0); |
| 280 | if (pos > @maxValue(usize)) { | |
| 281 | return error.FilePosLargerThanPointerRange; | |
| 280 | if (@sizeOf(@typeOf(pos)) > @sizeOf(usize)) { | |
| 281 | if (pos > @maxValue(usize)) { | |
| 282 | return error.FilePosLargerThanPointerRange; | |
| 283 | } | |
| 282 | 284 | } |
| 283 | 285 | |
| 284 | 286 | return usize(pos); |