We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
dbg_var_val
1 parent f1eed6a commit c37f00eCopy full SHA for c37f00e
src/codegen/llvm.zig
@@ -6743,7 +6743,10 @@ pub const FuncGen = struct {
6743
},
6744
"",
6745
);
6746
- } else if (owner_mod.optimize_mode == .Debug) {
+ } 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
+
6750
const alignment = operand_ty.abiAlignment(pt).toLlvm();
6751
const alloca = try self.buildAlloca(operand.typeOfWip(&self.wip), alignment);
6752
_ = try self.wip.store(.normal, operand, alloca, alignment);
0 commit comments