authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-08-18 14:55:24-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-08-18 20:36:27-07:00
logc6677be53bd41e7e9a208fb0c1c9135605c761cb
treebf8595b61138d0e2f25a2a87faa170128bebad7c
parent93ba960e3b799ebe1279fc5f1c759e5b1966d59b

llvm: disable instrumentation in naked functions

closes #21130

1 files changed, 2 insertions(+), 1 deletions(-)

src/codegen/llvm.zig+2-1
...@@ -1380,7 +1380,8 @@ pub const Object = struct {...@@ -1380,7 +1380,8 @@ pub const Object = struct {
1380 } else {1380 } else {
1381 _ = try attributes.removeFnAttr(.sanitize_thread);1381 _ = try attributes.removeFnAttr(.sanitize_thread);
1382 }1382 }
1383 if (owner_mod.fuzz and !func_analysis.disable_instrumentation) {1383 const is_naked = fn_info.cc == .Naked;
1384 if (owner_mod.fuzz and !func_analysis.disable_instrumentation and !is_naked) {
1384 try attributes.addFnAttr(.optforfuzzing, &o.builder);1385 try attributes.addFnAttr(.optforfuzzing, &o.builder);
1385 _ = try attributes.removeFnAttr(.skipprofile);1386 _ = try attributes.removeFnAttr(.skipprofile);
1386 _ = try attributes.removeFnAttr(.nosanitize_coverage);1387 _ = try attributes.removeFnAttr(.nosanitize_coverage);