| ... | @@ -1934,7 +1934,7 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -1934,7 +1934,7 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void { |
| 1934 | .ptr_elem_ptr => try self.airPtrElemPtr(inst), | 1934 | .ptr_elem_ptr => try self.airPtrElemPtr(inst), |
| 1935 | | 1935 | |
| 1936 | .inferred_alloc, .inferred_alloc_comptime => unreachable, | 1936 | .inferred_alloc, .inferred_alloc_comptime => unreachable, |
| 1937 | .unreach => if (self.wantSafety()) try self.airTrap() else self.finishAirBookkeeping(), | 1937 | .unreach => self.finishAirBookkeeping(), |
| 1938 | | 1938 | |
| 1939 | .optional_payload => try self.airOptionalPayload(inst), | 1939 | .optional_payload => try self.airOptionalPayload(inst), |
| 1940 | .optional_payload_ptr => try self.airOptionalPayloadPtr(inst), | 1940 | .optional_payload_ptr => try self.airOptionalPayloadPtr(inst), |
| ... | @@ -9813,8 +9813,7 @@ fn genSetReg(self: *Self, dst_reg: Register, ty: Type, src_mcv: MCValue) InnerEr | ... | @@ -9813,8 +9813,7 @@ fn genSetReg(self: *Self, dst_reg: Register, ty: Type, src_mcv: MCValue) InnerEr |
| 9813 | .register_overflow, | 9813 | .register_overflow, |
| 9814 | .reserved_frame, | 9814 | .reserved_frame, |
| 9815 | => unreachable, | 9815 | => unreachable, |
| 9816 | .undef => if (self.wantSafety()) | 9816 | .undef => {}, |
| 9817 | try self.genSetReg(dst_reg.to64(), Type.usize, .{ .immediate = 0xaaaaaaaaaaaaaaaa }), | | |
| 9818 | .eflags => |cc| try self.asmSetccRegister(dst_reg.to8(), cc), | 9817 | .eflags => |cc| try self.asmSetccRegister(dst_reg.to8(), cc), |
| 9819 | .immediate => |imm| { | 9818 | .immediate => |imm| { |
| 9820 | if (imm == 0) { | 9819 | if (imm == 0) { |
| ... | @@ -10098,8 +10097,7 @@ fn genSetMem(self: *Self, base: Memory.Base, disp: i32, ty: Type, src_mcv: MCVal | ... | @@ -10098,8 +10097,7 @@ fn genSetMem(self: *Self, base: Memory.Base, disp: i32, ty: Type, src_mcv: MCVal |
| 10098 | }; | 10097 | }; |
| 10099 | switch (src_mcv) { | 10098 | switch (src_mcv) { |
| 10100 | .none, .unreach, .dead, .reserved_frame => unreachable, | 10099 | .none, .unreach, .dead, .reserved_frame => unreachable, |
| 10101 | .undef => if (self.wantSafety()) | 10100 | .undef => {}, |
| 10102 | try self.genInlineMemset(dst_ptr_mcv, .{ .immediate = 0xaa }, .{ .immediate = abi_size }), | | |
| 10103 | .immediate => |imm| switch (abi_size) { | 10101 | .immediate => |imm| switch (abi_size) { |
| 10104 | 1, 2, 4 => { | 10102 | 1, 2, 4 => { |
| 10105 | const immediate = if (ty.isSignedInt(mod)) | 10103 | const immediate = if (ty.isSignedInt(mod)) |
| ... | @@ -12016,16 +12014,6 @@ fn resolveCallingConventionValues( | ... | @@ -12016,16 +12014,6 @@ fn resolveCallingConventionValues( |
| 12016 | return result; | 12014 | return result; |
| 12017 | } | 12015 | } |
| 12018 | | 12016 | |
| 12019 | /// TODO support scope overrides. Also note this logic is duplicated with `Module.wantSafety`. | | |
| 12020 | fn wantSafety(self: *Self) bool { | | |
| 12021 | return switch (self.bin_file.options.optimize_mode) { | | |
| 12022 | .Debug => true, | | |
| 12023 | .ReleaseSafe => true, | | |
| 12024 | .ReleaseFast => false, | | |
| 12025 | .ReleaseSmall => false, | | |
| 12026 | }; | | |
| 12027 | } | | |
| 12028 | | | |
| 12029 | fn fail(self: *Self, comptime format: []const u8, args: anytype) InnerError { | 12017 | fn fail(self: *Self, comptime format: []const u8, args: anytype) InnerError { |
| 12030 | @setCold(true); | 12018 | @setCold(true); |
| 12031 | assert(self.err_msg == null); | 12019 | assert(self.err_msg == null); |