<div dir="ltr">I think this should be fixed by r177854.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Mar 22, 2013 at 10:18 PM, Timur Iskhodzhanov <span dir="ltr"><<a href="mailto:timurrrr@google.com" target="_blank">timurrrr@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">OK, reverted then...<br>
Can you please help fix the Windows build caused by r177710?<br>
<br>
2013/3/22 Alexey Samsonov <<a href="mailto:samsonov@google.com">samsonov@google.com</a>>:<br>
<div class="HOEnZb"><div class="h5">><br>
> On Fri, Mar 22, 2013 at 10:05 PM, Timur Iskhodzhanov <<a href="mailto:timurrrr@google.com">timurrrr@google.com</a>><br>
> wrote:<br>
>><br>
>> Author: timurrrr<br>
>> Date: Fri Mar 22 13:05:28 2013<br>
>> New Revision: 177745<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=177745&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=177745&view=rev</a><br>
>> Log:<br>
>> Band-aid fix for the Windows build caused by r177710. Long-term,<br>
>> atomic_compare_exchange_strong should be a template on Windows too...<br>
>><br>
>> Modified:<br>
>>     compiler-rt/trunk/lib/asan/asan_allocator2.cc<br>
>><br>
>> Modified: compiler-rt/trunk/lib/asan/asan_allocator2.cc<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_allocator2.cc?rev=177745&r1=177744&r2=177745&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_allocator2.cc?rev=177745&r1=177744&r2=177745&view=diff</a><br>

>><br>
>> ==============================================================================<br>
>> --- compiler-rt/trunk/lib/asan/asan_allocator2.cc (original)<br>
>> +++ compiler-rt/trunk/lib/asan/asan_allocator2.cc Fri Mar 22 13:05:28 2013<br>
>> @@ -423,7 +423,8 @@ static void Deallocate(void *ptr, StackT<br>
>><br>
>>    u8 old_chunk_state = CHUNK_ALLOCATED;<br>
>>    // Flip the chunk_state atomically to avoid race on double-free.<br>
>> -  if (!atomic_compare_exchange_strong((atomic_uint8_t*)m,<br>
>> &old_chunk_state,<br>
>> +  if (!atomic_compare_exchange_strong((atomic_uintptr_t*)m,<br>
>> +                                      (uptr*)&old_chunk_state,<br>
>>                                        CHUNK_QUARANTINE,<br>
>> memory_order_relaxed)) {<br>
>>      if (old_chunk_state == CHUNK_QUARANTINE)<br>
>>        ReportDoubleFree((uptr)ptr, stack);<br>
><br>
><br>
> Wait, you should atomically store one byte, not sizeof(uintptr_t). I think<br>
> you will write some random garbage at address m in this way.<br>
><br>
>><br>
>><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>
><br>
><br>
><br>
> --<br>
> Alexey Samsonov, MSK<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div>
</div>