[llvm] [LLVM][rtsan] Add nosanitize_realtime instrumentation (PR #106125)

Chris Apple via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 28 06:46:34 PDT 2024


================
@@ -51,6 +53,7 @@ RealtimeSanitizerPass::RealtimeSanitizerPass(
 PreservedAnalyses RealtimeSanitizerPass::run(Function &F,
                                              AnalysisManager<Function> &AM) {
   if (F.hasFnAttribute(Attribute::SanitizeRealtime)) {
+    assert(!F.hasFnAttribute(Attribute::NoSanitizeRealtime));
----------------
cjappl wrote:

I guess another way to say the same thing as the previous comment:

ASan instruments and inspects every function in a binary. Asan disables on a per function basis.

RTSan instruments and inspects only in a specific context. RTSan disables on a per context basis.

This is the root of the difference and why we have to disable in this way, we are keeping state that tracks if we are in the context our sanitizer cares about.

https://github.com/llvm/llvm-project/pull/106125


More information about the llvm-commits mailing list