authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-12-11 01:24:10-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-12-11 12:48:17-07:00
log59bd296328ec290c5e00948003d98e83bf54a047
treeeee5896bfee9523ad0da4ffb1b62e59e18994a68
parentdd4ca88ca7a350189a27beb272e9869d2be0026e

std.build.InstallRawStep: fix compilation on wasm32-wasi


1 files changed, 3 insertions(+), 3 deletions(-)

lib/std/build/InstallRawStep.zig+3-3
...@@ -26,7 +26,7 @@ const BinaryElfSegment = struct {...@@ -26,7 +26,7 @@ const BinaryElfSegment = struct {
26 virtualAddress: u64,26 virtualAddress: u64,
27 elfOffset: u64,27 elfOffset: u64,
28 binaryOffset: u64,28 binaryOffset: u64,
29 fileSize: usize,29 fileSize: u64,
30 firstSection: ?*BinaryElfSection,30 firstSection: ?*BinaryElfSection,
31};31};
3232
...@@ -69,7 +69,7 @@ const BinaryElfOutput = struct {...@@ -69,7 +69,7 @@ const BinaryElfOutput = struct {
6969
70 const shstrtab_shdr = (try section_headers.next()).?;70 const shstrtab_shdr = (try section_headers.next()).?;
7171
72 const buffer = try allocator.alloc(u8, shstrtab_shdr.sh_size);72 const buffer = try allocator.alloc(u8, @intCast(usize, shstrtab_shdr.sh_size));
73 errdefer allocator.free(buffer);73 errdefer allocator.free(buffer);
7474
75 const num_read = try elf_file.preadAll(buffer, shstrtab_shdr.sh_offset);75 const num_read = try elf_file.preadAll(buffer, shstrtab_shdr.sh_offset);
...@@ -301,7 +301,7 @@ const HexWriter = struct {...@@ -301,7 +301,7 @@ const HexWriter = struct {
301 const row_address = @intCast(u32, segment.physicalAddress + bytes_read);301 const row_address = @intCast(u32, segment.physicalAddress + bytes_read);
302302
303 const remaining = segment.fileSize - bytes_read;303 const remaining = segment.fileSize - bytes_read;
304 const to_read = @min(remaining, MAX_PAYLOAD_LEN);304 const to_read = @intCast(usize, @min(remaining, MAX_PAYLOAD_LEN));
305 const did_read = try elf_file.preadAll(buf[0..to_read], segment.elfOffset + bytes_read);305 const did_read = try elf_file.preadAll(buf[0..to_read], segment.elfOffset + bytes_read);
306 if (did_read < to_read) return error.UnexpectedEOF;306 if (did_read < to_read) return error.UnexpectedEOF;
307307