[clang] [ASAN] For Asan instrumented global, emit two symbols, one with actual size and other with instrumented size. (PR #70166)

via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 25 00:04:03 PDT 2023


================
@@ -2441,6 +2441,9 @@ void ModuleAddressSanitizer::instrumentGlobals(IRBuilder<> &IRB, Module &M,
     // zero so we can copy the metadata over as is.
     NewGlobal->copyMetadata(G, 0);
 
+    // Attach "asan_instrumented" attribute to the new global.
+    NewGlobal->addAttribute(Attribute::SanitizeAddress);
----------------
skc7 wrote:

This would be replaced by "asan_instrumented" attributes, once #68865 gets approved and merged.

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


More information about the cfe-commits mailing list