[PATCH] D117285: [msan] Copy origin of byval arguments
Vitaly Buka via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 15 00:51:53 PST 2022
vitalybuka requested review of this revision.
vitalybuka added inline comments.
================
Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:1741
+ getOriginPtrForArgument(&FArg, EntryIRB, ArgOffset);
+ EntryIRB.CreateMemCpy(CpOriginPtr, CopyAlign, OriginPtr,
+ CopyAlign, Size);
----------------
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.
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