| ... | ... | @@ -6743,7 +6743,10 @@ pub const FuncGen = struct { |
| 6743 | 6743 | }, |
| 6744 | 6744 | "", |
| 6745 | 6745 | ); |
| 6746 | | } else if (owner_mod.optimize_mode == .Debug) { |
| 6746 | } else if (owner_mod.optimize_mode == .Debug and !self.is_naked) { |
| 6747 | // We avoid taking this path for naked functions because there's no guarantee that such |
| 6748 | // functions even have a valid stack pointer, making the `alloca` + `store` unsafe. |
| 6749 | |
| 6747 | 6750 | const alignment = operand_ty.abiAlignment(pt).toLlvm(); |
| 6748 | 6751 | const alloca = try self.buildAlloca(operand.typeOfWip(&self.wip), alignment); |
| 6749 | 6752 | _ = try self.wip.store(.normal, operand, alloca, alignment); |