[PATCH] D123602: [MSan] Ensure argument shadow initialized on memcpy

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 12 09:47:33 PDT 2022


vitalybuka added a comment.

In D123602#3445899 <https://reviews.llvm.org/D123602#3445899>, @nikic wrote:

> In D123602#3445885 <https://reviews.llvm.org/D123602#3445885>, @vitalybuka wrote:
>
>> I am not sure how this can help, I will try later today.
>> As I see it it just calculates the shadow address and these instructions will be removed as unused?
>
> Shadow memory for arguments is lazily initialized. If we never call getShadow() for an argument, then we'll leave it uninitialized. In most cases this happens naturally, but for memcpy/memmove we call a builtin that will access the shadow internally, so we never perform the getShadow() call and never initialize the shadow.

I see. I suspect it does not work if instead of llvm.memcpy we have "call void @foo(i8* %p)" and "call void @foo_noundef(i8* noundef %p)"?


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

https://reviews.llvm.org/D123602



More information about the llvm-commits mailing list