[PATCH] [asan-asm-instrumentation] Fixed memory accesses with rbp as a base or an index register.

Evgeniy Stepanov eugenis at google.com
Mon Oct 20 10:39:47 PDT 2014


LGTM w/ nits

================
Comment at: lib/Target/X86/AsmParser/X86AsmInstrumentation.cpp:74
@@ -68,2 +73,3 @@
 
     unsigned addressReg(MVT::SimpleValueType VT) const {
+      return convReg(BusyRegs[0], VT);
----------------
I think these should start with a capital letter.

================
Comment at: lib/Target/X86/AsmParser/X86AsmInstrumentation.cpp:79
@@ -73,3 +78,3 @@
     unsigned shadowReg(MVT::SimpleValueType VT) const {
-      return getX86SubSuperRegister(ShadowReg, VT);
+      return convReg(BusyRegs[1], VT);
     }
----------------
I'd prefer named constants (or an enum) instead of magic index constants 0, 1, 2.

================
Comment at: lib/Target/X86/AsmParser/X86AsmInstrumentation.cpp:92
@@ +91,3 @@
+      addBusyReg(Op.getMemBaseReg());
+      addBusyReg(Op.getMemIndexReg());
+    }
----------------
This may add NoRegister to BusyRegs, better avoid it.

http://reviews.llvm.org/D5819






More information about the llvm-commits mailing list