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

Evgeniy Stepanov eugeni.stepanov at gmail.com
Fri Mar 2 02:47:11 PST 2012


Added a bug link and committed as r151887, r151888.

On Thu, Mar 1, 2012 at 10:42 PM, Kostya Serebryany <kcc at google.com> wrote:
> 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
>>
>




More information about the llvm-commits mailing list