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

Yuri Gorshenin ygorshenin at chromium.org
Wed Mar 5 05:04:26 PST 2014


Comment at: lib/Target/X86/AsmParser/X86AsmInstrumentation.h:27
@@ +26,3 @@
+  virtual bool TryToInstrumentInstruction(
+      MCInst &Inst,
Evgeniy Stepanov wrote:
> Maybe simply "InstrumentInstruction"?
> Also, please add some comments.
> - is it called before or after the original instruction, or maybe it is required to emit the original instruction to the streamer as well?
> - can the original instruction be modified? Turn it into a const reference if not?

Comment at: lib/Target/X86/AsmParser/X86AsmParser.cpp:2244
@@ +2243,3 @@
+    // FIXME: find out a better place for instrumentation.
+    Instrumentation
+        ->TryToInstrumentInstruction(Inst, Operands, getContext(), Out);
Evgeniy Stepanov wrote:
> It looks like this code can do instrumentation even if the instruction itself is not emitted due to MatchingInlineAsm (btw, why is not emitted in that case??).
MatchAndEmitInstruction() is called from AsmParser with ParsingInlineAsm parameter. Comment to this parameter says that it's true when MS-style assembly is parsed, so it's not our case.


More information about the llvm-commits mailing list