about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/attributes.rs
diff options
context:
space:
mode:
authorWesley Norris <repnop@outlook.com>2022-09-11 19:36:19 -0400
committerWesley Norris <repnop@outlook.com>2023-02-14 20:54:25 -0500
commit19714385e06f5c9281455c5ce69368f05885cdc8 (patch)
tree2d60e76a592df13258a96f8ddbd3fa4d3f345f78 /compiler/rustc_codegen_llvm/src/attributes.rs
parent0416b1a6f6d5c42696494e1a3a33580fd3f669d8 (diff)
downloadrust-19714385e06f5c9281455c5ce69368f05885cdc8.tar.gz
rust-19714385e06f5c9281455c5ce69368f05885cdc8.zip
Add `kernel-address` sanitizer support for freestanding targets
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/attributes.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/attributes.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/attributes.rs b/compiler/rustc_codegen_llvm/src/attributes.rs
index 7a4ec494c8e..651d644ebb6 100644
--- a/compiler/rustc_codegen_llvm/src/attributes.rs
+++ b/compiler/rustc_codegen_llvm/src/attributes.rs
@@ -62,7 +62,7 @@ pub fn sanitize_attrs<'ll>(
 ) -> SmallVec<[&'ll Attribute; 4]> {
     let mut attrs = SmallVec::new();
     let enabled = cx.tcx.sess.opts.unstable_opts.sanitizer - no_sanitize;
-    if enabled.contains(SanitizerSet::ADDRESS) {
+    if enabled.contains(SanitizerSet::ADDRESS) || enabled.contains(SanitizerSet::KERNELADDRESS) {
         attrs.push(llvm::AttributeKind::SanitizeAddress.create_attr(cx.llcx));
     }
     if enabled.contains(SanitizerSet::MEMORY) {