[PATCH] D117285: [msan] Copy origin of byval arguments

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 27 14:08:26 PST 2022


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

LGTM



================
Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:1741
+                    getOriginPtrForArgument(&FArg, EntryIRB, ArgOffset);
+                EntryIRB.CreateMemCpy(CpOriginPtr, CopyAlign, OriginPtr,
+                                      CopyAlign, Size);
----------------
vitalybuka wrote:
> eugenis wrote:
> > This can get weird if the byval pointer is less than 4 byte aligned, but the alternatives are not pretty, either.
> > 
> > Also, you can bump the alignment `std::max(CopyAlign, kMinOriginAlignment)`.
> Not sure if OriginPtr can be aligned higher then kMinOriginAlignment, as origin_tls base is 4 bytes aligned.
> CpOriginPtr can be aligned higher, but I guess it does not matter here.
> 
> Also please notice the I changed copy size.
yes, you are right


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117285



More information about the llvm-commits mailing list