Commit 1f823eecdd

Andrew Kelley <andrew@ziglang.org>
2022-01-21 00:21:49
stage2: fix compilation on 32 bit targets
1 parent 1417698
src/Liveness.zig
@@ -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) {
src/print_air.zig
@@ -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});
src/Sema.zig
@@ -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: {