[PATCH] [clang/asan] Do not emit memcpy for trivial operator= when -fsanitize-address-field-padding >= 1

Kostya Serebryany kcc at google.com
Fri Nov 7 10:13:49 PST 2014

On Thu, Nov 6, 2014 at 6:14 PM, Chandler Carruth <chandlerc at google.com>

> Have you thought about force emitting the memcpy metadata that describes
> the padding holes in the struct, and use that to predicate the
> instrumentation?
> While there is some risk that the optimizer loses this information,
> frankly, we want to find all those places and fix them.

This sounds like an overkill (or I don't understand your proposal).
mempcy emitted by clang is no more than optimization and we simply disable
it when inserting the poisoned paddings.
This is the second place where I had to disable memcpy and with this patch
I successfully run multiple MLOC.
There might be 1 or 2 more places where we'll need to disable memcpy and
that's all.

> On Thu, Nov 6, 2014 at 8:01 PM, Kostya Serebryany <kcc at google.com> wrote:
>> Hi majnemer, rsmith,
>> If we've added poisoned paddings to a type do not emit memcpy for
>> operator=.
>> http://reviews.llvm.org/D6160
>> Files:
>>   lib/CodeGen/CGExprCXX.cpp
>>   test/CodeGen/sanitize-address-field-padding.cpp
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141107/a0006689/attachment.html>

More information about the cfe-commits mailing list