[PATCH] [ASan] Initial support for Kernel AddressSanitizer

Alexey Samsonov vonosmas at gmail.com
Thu Jun 18 16:30:31 PDT 2015


LGTM


================
Comment at: tools/clang/lib/AST/Decl.cpp:3684
@@ -3683,2 +3683,3 @@
   ASTContext &Context = getASTContext();
-  if (!Context.getLangOpts().Sanitize.has(SanitizerKind::Address) ||
+  if (!(Context.getLangOpts().Sanitize.hasOneOf(
+          SanitizerKind::Address | SanitizerKind::KernelAddress)) ||
----------------
remove extra parens around `hasOneOf` call

================
Comment at: tools/clang/test/CodeGen/address-safety-attr-kasan.cpp:10
@@ +9,3 @@
+}
+// CHECK-NOASAN: [[Function Attrs: nounwind$]]
+// CHECK-ASAN: Function Attrs: nounwind sanitize_address
----------------
Please check this syntax. I thought that [[]] is used to define FileCheck variables, while {{}} are used for regular expressions.

================
Comment at: tools/clang/test/Driver/asan.c:1
@@ -1,5 +1,2 @@
-// RUN: %clang     -target i386-unknown-unknown -fsanitize=address %s -S -emit-llvm -o - | FileCheck %s
-// RUN: %clang -O1 -target i386-unknown-unknown -fsanitize=address %s -S -emit-llvm -o - | FileCheck %s
-// RUN: %clang -O2 -target i386-unknown-unknown -fsanitize=address %s -S -emit-llvm -o - | FileCheck %s
-// RUN: %clang -O3 -target i386-unknown-unknown -fsanitize=address %s -S -emit-llvm -o - | FileCheck %s
-// Verify that -fsanitize=address invokes asan instrumentation.
+// RUN: %clang     -target i386-unknown-unknown -fsanitize=address %s -S -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-ASAN
+// RUN: %clang -O1 -target i386-unknown-unknown -fsanitize=address %s -S -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-ASAN
----------------
while you're here, please add linux to original RUN-lines as well.

http://reviews.llvm.org/D10411

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list