llvm: disable instrumentation in naked functions

closes #21130
This commit is contained in:
Andrew Kelley
2024-08-18 14:55:24 -07:00
parent 93ba960e3b
commit c6677be53b

View File

@@ -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);