[PATCH] D45047: MSan: introduce the conservative assembly handling mode.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 29 14:00:11 PDT 2018


eugenis accepted this revision.
eugenis added a comment.
This revision is now accepted and ready to land.

This approach can not handle arrays - it would unpoison only the first element. It could be confusing for the user, but not really worse than the current state. Please mention this in the comment and/or the flag description.

I think it's OK to enable this feature by default.



================
Comment at: lib/Transforms/Instrumentation/MemorySanitizer.cpp:3080
+
+  void visitAsmInstruction(Instruction &I) {
+    // Conservative inline assembly handling: check for poisoned shadow of
----------------
Move this above visitInstruction.


================
Comment at: lib/Transforms/Instrumentation/MemorySanitizer.cpp:3110
+          IRB.CreatePointerCast(ShadowPtr, CShadow->getType()->getPointerTo()));
+      if (MS.TrackOrigins)
+        storeOrigin(IRB, Operand, CShadow, getCleanOrigin(), OriginPtr,
----------------
Origin is meaningless for unpoisoned memory. All this does is potentially destroy origin info for adjacent memory in case of a less than 4 byte store.


Repository:
  rL LLVM

https://reviews.llvm.org/D45047





More information about the llvm-commits mailing list