Both patches look good, thank you! <div>You may want to mention the bug in the test's comments. <br><div><br></div><div>--kcc <br><br><div class="gmail_quote">On Wed, Feb 29, 2012 at 11:21 PM, Evgeniy Stepanov <span dir="ltr"><<a href="mailto:eugeni.stepanov@gmail.com">eugeni.stepanov@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
as Eli correctly pointed out in<br>
<a href="http://llvm.org/bugs/show_bug.cgi?id=12047" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=12047</a>, it is not a good idea to<br>
set up stack allocation redzones based on<br>
TargetData::getTypeStoreSize. One case when this produces undesired<br>
results is an optimization in InstCombine pass<br>
(PromoteCastOfAllocation), which can replace  alloca(T) with<br>
alloca(S), where S has the same AllocSize, but a smaller StoreSize.<br>
Another case is memcpy(long double => long double), where ASan will<br>
poison bytes 10-15 of a stack-allocated long double (StoreSize  10,<br>
AllocSize 16, sizeof(long double) = 16).<br>
<br>
This patch replaces getTypeStoreSize with getTypeAllocSize in<br>
AddressSanitizer instrumentation for stack allocations. Another patch<br>
adds a test.<br>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div></div>