[PATCH] D81699: MemorySanitizer: Add option to insert init checks at call site

Gui Andrade via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 22 10:45:03 PDT 2020


guiand marked 2 inline comments as done.
guiand added inline comments.


================
Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:1270
+      unsigned i = 0;
+      for (auto it = strct->element_begin(); it != strct->element_end(); i++, it++) {
+        Value *ShadowItem;
----------------
vitalybuka wrote:
> so if we need integer index, then just iterate with getNumElements() getElementType(unsigned N) ?
> range base loop and separate var is fine as well
> 
> BTW. the first "i" is 1, is it expected?
Makes sense to use `getElementType`. But I think here the first `i` is still 0, as the `i++` expression happens after each loop body.


================
Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:1749
+
+        if (!FArgCheck)
+          ArgOffset += alignTo(Size, kShadowTLSAlignment);
----------------
vitalybuka wrote:
> why do we need this?
This change allows checked arguments to not take up TLS space since they don't use the TLS for anything anyway. That frees up more TLS for arguments which can't be checked.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81699/new/

https://reviews.llvm.org/D81699





More information about the llvm-commits mailing list