| ... | ... | @@ -686,6 +686,8 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void { |
| 686 | 686 | // zig fmt: on |
| 687 | 687 | } |
| 688 | 688 | |
| 689 | assert(!self.register_manager.lockedRegsExist()); |
| 690 | |
| 689 | 691 | if (std.debug.runtime_safety) { |
| 690 | 692 | if (self.air_bookkeeping < old_air_bookkeeping + 1) { |
| 691 | 693 | std.debug.panic("in codegen.zig, handling of AIR instruction %{d} ('{}') did not do proper bookkeeping. Look for a missing call to finishAir.", .{ inst, air_tags[inst] }); |
| ... | ... | @@ -2915,7 +2917,7 @@ fn isNonErr(self: *Self, ty: Type, operand: MCValue) !MCValue { |
| 2915 | 2917 | switch (is_err_result) { |
| 2916 | 2918 | .compare_flags_unsigned => |op| { |
| 2917 | 2919 | assert(op.cmp == .gt); |
| 2918 | | return MCValue{ .compare_flags_unsigned = .{ .cmp = .gt, .ccr = op.ccr } }; |
| 2920 | return MCValue{ .compare_flags_unsigned = .{ .cmp = .lte, .ccr = op.ccr } }; |
| 2919 | 2921 | }, |
| 2920 | 2922 | .immediate => |imm| { |
| 2921 | 2923 | assert(imm == 0); |
| ... | ... | @@ -3176,7 +3178,7 @@ fn resolveInst(self: *Self, inst: Air.Inst.Ref) InnerError!MCValue { |
| 3176 | 3178 | const ref_int = @enumToInt(inst); |
| 3177 | 3179 | if (ref_int < Air.Inst.Ref.typed_value_map.len) { |
| 3178 | 3180 | const tv = Air.Inst.Ref.typed_value_map[ref_int]; |
| 3179 | | if (!tv.ty.hasRuntimeBits()) { |
| 3181 | if (!tv.ty.hasRuntimeBits() and !tv.ty.isError()) { |
| 3180 | 3182 | return MCValue{ .none = {} }; |
| 3181 | 3183 | } |
| 3182 | 3184 | return self.genTypedValue(tv); |
| ... | ... | @@ -3184,7 +3186,7 @@ fn resolveInst(self: *Self, inst: Air.Inst.Ref) InnerError!MCValue { |
| 3184 | 3186 | |
| 3185 | 3187 | // If the type has no codegen bits, no need to store it. |
| 3186 | 3188 | const inst_ty = self.air.typeOf(inst); |
| 3187 | | if (!inst_ty.hasRuntimeBits()) |
| 3189 | if (!inst_ty.hasRuntimeBits() and !inst_ty.isError()) |
| 3188 | 3190 | return MCValue{ .none = {} }; |
| 3189 | 3191 | |
| 3190 | 3192 | const inst_index = @intCast(Air.Inst.Index, ref_int - Air.Inst.Ref.typed_value_map.len); |