aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-12-11 01:24:10 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-12-11 12:48:17 -0700
commit59bd296328ec290c5e00948003d98e83bf54a047 (patch)
treeeee5896bfee9523ad0da4ffb1b62e59e18994a68 /lib/std
parentdd4ca88ca7a350189a27beb272e9869d2be0026e (diff)
downloadzig-59bd296328ec290c5e00948003d98e83bf54a047.tar.gz
zig-59bd296328ec290c5e00948003d98e83bf54a047.zip
std.build.InstallRawStep: fix compilation on wasm32-wasi
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/build/InstallRawStep.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/build/InstallRawStep.zig b/lib/std/build/InstallRawStep.zig
index 1d0a5c400f..41b3918cf0 100644
--- a/lib/std/build/InstallRawStep.zig
+++ b/lib/std/build/InstallRawStep.zig
@@ -26,7 +26,7 @@ const BinaryElfSegment = struct {
virtualAddress: u64,
elfOffset: u64,
binaryOffset: u64,
- fileSize: usize,
+ fileSize: u64,
firstSection: ?*BinaryElfSection,
};
@@ -69,7 +69,7 @@ const BinaryElfOutput = struct {
const shstrtab_shdr = (try section_headers.next()).?;
- const buffer = try allocator.alloc(u8, shstrtab_shdr.sh_size);
+ const buffer = try allocator.alloc(u8, @intCast(usize, shstrtab_shdr.sh_size));
errdefer allocator.free(buffer);
const num_read = try elf_file.preadAll(buffer, shstrtab_shdr.sh_offset);
@@ -301,7 +301,7 @@ const HexWriter = struct {
const row_address = @intCast(u32, segment.physicalAddress + bytes_read);
const remaining = segment.fileSize - bytes_read;
- const to_read = @min(remaining, MAX_PAYLOAD_LEN);
+ const to_read = @intCast(usize, @min(remaining, MAX_PAYLOAD_LEN));
const did_read = try elf_file.preadAll(buf[0..to_read], segment.elfOffset + bytes_read);
if (did_read < to_read) return error.UnexpectedEOF;