r145953<br><br><div class="gmail_quote">On Tue, Dec 6, 2011 at 3:04 AM, Alexander Potapenko <span dir="ltr"><<a href="mailto:glider@google.com">glider@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Including asan_test_utils.h is not possible, because 'extern "C"' and<br>
'template' is not valid ObjC code.<br>
Let it be volatile, otherwise we'll need to write a separate<br>
asan_test_utils for ObjC, which'll be an overkill.<br>
<div class="HOEnZb"><div class="h5"><br>
On Mon, Dec 5, 2011 at 11:04 PM, Kostya Serebryany <<a href="mailto:kcc@google.com">kcc@google.com</a>> wrote:<br>
> I wonder if you can reuse Ident() from tests/asan_test_utils.h instead of<br>
> using volatile.<br>
> Like this:<br>
>   char *mem = Ident(malloc(10));<br>
><br>
> // This function returns its parameter but in such a way that compiler<br>
><br>
><br>
> // can not prove it.<br>
><br>
><br>
> template<class T><br>
><br>
><br>
> __attribute__((noinline))<br>
><br>
><br>
> static T Ident(T t) {<br>
> ...<br>
><br>
><br>
> --kcc<br>
><br>
><br>
> On Mon, Dec 5, 2011 at 12:44 AM, Alexander Potapenko <<a href="mailto:glider@google.com">glider@google.com</a>><br>
> wrote:<br>
>><br>
>> Fix GCD tests for AddressSanitizer on Mac.<br>
>> The following patch declares the char* vars holding the memory<br>
>> allocations as volatile, which prevents the compiler from optimizing<br>
>> them and breaking the tests.<br>
>> I'm also enabling the tests by default, as the GCD support in ASan<br>
>> runtime library is quite stable already.<br>
>><br>
>> --<br>
>> Alexander Potapenko<br>
>> Software Engineer<br>
>> Google Moscow<br>
><br>
><br>
<br>
<br>
<br>
--<br>
Alexander Potapenko<br>
Software Engineer<br>
Google Moscow<br>
</div></div></blockquote></div><br>