mirror of
https://github.com/ziglang/zig.git
synced 2026-01-04 20:43:19 +00:00
Re-enable building the self-hosted compiler for 32-bit targets
This commit is contained in:
parent
8c5d4295e5
commit
4c75f834e7
@ -1071,7 +1071,7 @@ pub const Scope = struct {
|
||||
if (stat.size > std.math.maxInt(u32))
|
||||
return error.FileTooBig;
|
||||
|
||||
const source = try gpa.allocSentinel(u8, stat.size, 0);
|
||||
const source = try gpa.allocSentinel(u8, @intCast(usize, stat.size), 0);
|
||||
defer if (!file.source_loaded) gpa.free(source);
|
||||
const amt = try f.readAll(source);
|
||||
if (amt != stat.size)
|
||||
@ -2441,7 +2441,7 @@ pub fn astGenFile(mod: *Module, file: *Scope.File, prog_node: *std.Progress.Node
|
||||
if (stat.size > std.math.maxInt(u32))
|
||||
return error.FileTooBig;
|
||||
|
||||
const source = try gpa.allocSentinel(u8, stat.size, 0);
|
||||
const source = try gpa.allocSentinel(u8, @intCast(usize, stat.size), 0);
|
||||
defer if (!file.source_loaded) gpa.free(source);
|
||||
const amt = try source_file.readAll(source);
|
||||
if (amt != stat.size)
|
||||
|
||||
@ -2483,7 +2483,7 @@ fn zirIntToError(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerEr
|
||||
const payload = try sema.arena.create(Value.Payload.Error);
|
||||
payload.* = .{
|
||||
.base = .{ .tag = .@"error" },
|
||||
.data = .{ .name = sema.mod.error_name_list.items[int] },
|
||||
.data = .{ .name = sema.mod.error_name_list.items[@intCast(usize, int)] },
|
||||
};
|
||||
return sema.mod.constInst(sema.arena, src, .{
|
||||
.ty = Type.initTag(.anyerror),
|
||||
|
||||
@ -3642,7 +3642,7 @@ pub fn cmdAstCheck(
|
||||
if (stat.size > max_src_size)
|
||||
return error.FileTooBig;
|
||||
|
||||
const source = try arena.allocSentinel(u8, stat.size, 0);
|
||||
const source = try arena.allocSentinel(u8, @intCast(usize, stat.size), 0);
|
||||
const amt = try f.readAll(source);
|
||||
if (amt != stat.size)
|
||||
return error.UnexpectedEndOfFile;
|
||||
@ -3778,7 +3778,7 @@ pub fn cmdChangelist(
|
||||
.root_decl = null,
|
||||
};
|
||||
|
||||
const source = try arena.allocSentinel(u8, stat.size, 0);
|
||||
const source = try arena.allocSentinel(u8, @intCast(usize, stat.size), 0);
|
||||
const amt = try f.readAll(source);
|
||||
if (amt != stat.size)
|
||||
return error.UnexpectedEndOfFile;
|
||||
@ -3818,7 +3818,7 @@ pub fn cmdChangelist(
|
||||
if (new_stat.size > max_src_size)
|
||||
return error.FileTooBig;
|
||||
|
||||
const new_source = try arena.allocSentinel(u8, new_stat.size, 0);
|
||||
const new_source = try arena.allocSentinel(u8, @intCast(usize, new_stat.size), 0);
|
||||
const new_amt = try new_f.readAll(new_source);
|
||||
if (new_amt != new_stat.size)
|
||||
return error.UnexpectedEndOfFile;
|
||||
|
||||
@ -2641,7 +2641,7 @@ pub const Type = extern union {
|
||||
};
|
||||
const end_val = Value.initPayload(&end_payload.base);
|
||||
if (int_val.compare(.gte, end_val)) return null;
|
||||
return int_val.toUnsignedInt();
|
||||
return @intCast(usize, int_val.toUnsignedInt());
|
||||
}
|
||||
};
|
||||
switch (ty.tag()) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user