From c6677be53bd41e7e9a208fb0c1c9135605c761cb Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 18 Aug 2024 14:55:24 -0700 Subject: [PATCH] llvm: disable instrumentation in naked functions closes #21130 --- src/codegen/llvm.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index acceea175a..750e137179 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -1380,7 +1380,8 @@ pub const Object = struct { } else { _ = try attributes.removeFnAttr(.sanitize_thread); } - if (owner_mod.fuzz and !func_analysis.disable_instrumentation) { + const is_naked = fn_info.cc == .Naked; + if (owner_mod.fuzz and !func_analysis.disable_instrumentation and !is_naked) { try attributes.addFnAttr(.optforfuzzing, &o.builder); _ = try attributes.removeFnAttr(.skipprofile); _ = try attributes.removeFnAttr(.nosanitize_coverage);