If we've added poisoned paddings to a type do not emit memcpy for operator=.
Details
Details
- Reviewers
majnemer rsmith - Commits
- rG4133eabb45b6: [clang/asan] Do not emit memcpy for trivial operator= when -fsanitize-address…
rC221739: [clang/asan] Do not emit memcpy for trivial operator= when -fsanitize-address…
rL221739: [clang/asan] Do not emit memcpy for trivial operator= when -fsanitize-address…
Diff Detail
Diff Detail
Event Timeline
Comment Actions
LGTM, assuming the answer to my question is 'no'.
lib/CodeGen/CGExprCXX.cpp | ||
---|---|---|
321 | Is mayInsertExtraPadding ever true for a union? The non-memcpy path will not do the right thing for a trivial assignment operator in that case. |
lib/CodeGen/CGExprCXX.cpp | ||
---|---|---|
321 | It is never true: bool RecordDecl::mayInsertExtraPadding(bool EmitRemark) const { else if (CXXRD->isUnion()) ReasonToReject = 2; // is a union. |
Is mayInsertExtraPadding ever true for a union? The non-memcpy path will not do the right thing for a trivial assignment operator in that case.