| author | |
| committer | |
| log | 403a46abccbc03e70e7975d00a5134867a1d4fc7 |
| tree | 012fe18be87f4b97ceb52000c8aa06b614800e54 |
| parent | 6bf1547148caf0c63605a42c8cdea608cf3d4eca |
1 files changed, 3 insertions(+), 1 deletions(-)
std/io.zig+3-1| ... | @@ -273,7 +273,9 @@ pub const File = struct { | ... | @@ -273,7 +273,9 @@ pub const File = struct { |
| 273 | else => os.unexpectedErrorWindows(err), | 273 | else => os.unexpectedErrorWindows(err), |
| 274 | }; | 274 | }; |
| 275 | } | 275 | } |
| 276 | return @bitCast(usize, file_size); | 276 | if (file_size < 0) |
| 277 | return error.Overflow; | ||
| 278 | return math.cast(usize, u64(file_size)); | ||
| 277 | } else { | 279 | } else { |
| 278 | unreachable; | 280 | unreachable; |
| 279 | } | 281 | } |