[llvm-commits] [asan] Use getTypeAllocSize instead of getTypeStoreSize

Kostya Serebryany kcc at google.com
Thu Mar 1 10:42:36 PST 2012


Both patches look good, thank you!
You may want to mention the bug in the test's comments.

--kcc

On Wed, Feb 29, 2012 at 11:21 PM, Evgeniy Stepanov <
eugeni.stepanov at gmail.com> wrote:

> Hi,
>
> as Eli correctly pointed out in
> http://llvm.org/bugs/show_bug.cgi?id=12047, it is not a good idea to
> set up stack allocation redzones based on
> TargetData::getTypeStoreSize. One case when this produces undesired
> results is an optimization in InstCombine pass
> (PromoteCastOfAllocation), which can replace  alloca(T) with
> alloca(S), where S has the same AllocSize, but a smaller StoreSize.
> Another case is memcpy(long double => long double), where ASan will
> poison bytes 10-15 of a stack-allocated long double (StoreSize  10,
> AllocSize 16, sizeof(long double) = 16).
>
> This patch replaces getTypeStoreSize with getTypeAllocSize in
> AddressSanitizer instrumentation for stack allocations. Another patch
> adds a test.
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120301/fb3b0350/attachment.html>


More information about the llvm-commits mailing list