stage2: fix compilation on 32 bit targets

This commit is contained in:
Andrew Kelley 2022-01-20 16:21:49 -07:00
parent 1417698c11
commit 1f823eecdd
3 changed files with 3 additions and 3 deletions

View File

@ -373,7 +373,7 @@ fn analyzeInst(
.vector_init => {
const ty_pl = inst_datas[inst].ty_pl;
const vector_ty = a.air.getRefType(ty_pl.ty);
const len = vector_ty.arrayLen();
const len = @intCast(usize, vector_ty.arrayLen());
const elements = @bitCast([]const Air.Inst.Ref, a.air.extra[ty_pl.payload..][0..len]);
if (elements.len <= bpi - 1) {

View File

@ -15056,7 +15056,7 @@ fn coerceTupleToArray(
) !Air.Inst.Ref {
const inst_ty = sema.typeOf(inst);
const inst_len = inst_ty.arrayLen();
const dest_len = dest_ty.arrayLen();
const dest_len = try sema.usizeCast(block, dest_ty_src, dest_ty.arrayLen());
if (dest_len != inst_len) {
const msg = msg: {

View File

@ -296,7 +296,7 @@ const Writer = struct {
fn writeVectorInit(w: *Writer, s: anytype, inst: Air.Inst.Index) @TypeOf(s).Error!void {
const ty_pl = w.air.instructions.items(.data)[inst].ty_pl;
const vector_ty = w.air.getRefType(ty_pl.ty);
const len = vector_ty.arrayLen();
const len = @intCast(usize, vector_ty.arrayLen());
const elements = @bitCast([]const Air.Inst.Ref, w.air.extra[ty_pl.payload..][0..len]);
try s.print("{}, [", .{vector_ty});