[PATCH] Added address sanitizer instrumentation for MOV and MOVAPS inline assembly instructions.

Yuri Gorshenin ygorshenin at chromium.org
Thu Feb 27 01:29:46 PST 2014


  PTAL


================
Comment at: lib/Target/X86/AsmParser/X86AddressSanitizer.cpp:207
@@ +206,3 @@
+  // Set %rsp below current red zone (128 bytes wide)
+  EmitInstruction(Out, MCInstBuilder(X86::SUB64ri32)
+                           .addReg(X86::RSP)
----------------
Evgeniy Stepanov wrote:
> Does stack unwinding in ASan reports still work? I'm pretty sure you need to describe stack manipulations with CFI directives. OK to leave a FIXME for now.
Done.

================
Comment at: lib/Target/X86/AsmParser/X86AsmParser.cpp:59
@@ -56,2 +58,3 @@
   ParseInstructionInfo *InstInfo;
+  OwningPtr<X86AddressSanitizer> Asan;
 private:
----------------
Evgeniy Stepanov wrote:
> Ideally, this file should never mention AddressSanitizer. There are other sanitizers that we would to choose based on the function attributes. Perhaps rename the base class to something like X86Instrumentation or X86(Asm|MC)Instrumentation.
Done.

================
Comment at: test/Instrumentation/AddressSanitizer/X86/load.ll:1
@@ +1,2 @@
+; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 -mattr=+sse2 -asan-instrument-inline-assembly | FileCheck %s
+
----------------
Evgeniy Stepanov wrote:
> Please add tests for
> - no instrumentation (i.e. compilation without -sanitize=address)
> - instrumentation of a .S source
> 
Done.


http://llvm-reviews.chandlerc.com/D2881



More information about the llvm-commits mailing list