[MSan] Ensure argument shadow initialized on memcpy
authorNikita Popov <npopov@redhat.com>
Tue, 12 Apr 2022 20:45:53 +0000 (13:45 -0700)
committerVitaly Buka <vitalybuka@google.com>
Tue, 12 Apr 2022 21:53:02 +0000 (14:53 -0700)
commit0adadfa68f82c1505e06ffb56c0d7e63dc3ac206
tree69a76a5df6c292e99b4716b06ff2ecc9063b759c
parentefdc90baaaebd7d9a8aa72735bd605ee04ac5749
[MSan] Ensure argument shadow initialized on memcpy

We need to explicitly query the shadow here, because it is lazily
initialized for byval arguments. Without opaque pointers this used to
mostly work out, because there would be a bitcast to `i8*` present, and
that would query, and copy in case of byval, the argument shadow.

Reviewed By: vitalybuka, eugenis

Differential Revision: https://reviews.llvm.org/D123602
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
llvm/test/Instrumentation/MemorySanitizer/opaque-ptr.ll [new file with mode: 0644]