<div dir="ltr">kDirectlyLeaked is the default value.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 4, 2013 at 8:10 PM, Alexander Potapenko <span dir="ltr"><<a href="mailto:glider@google.com" target="_blank">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">Should we mark the memory as directly leaked if t is NULL?<br>
<div class="HOEnZb"><div class="h5"><br>
On Tue, Jun 4, 2013 at 2:39 PM, Sergey Matveev <<a href="mailto:earthdok@google.com">earthdok@google.com</a>> wrote:<br>
> Author: smatveev<br>
> Date: Tue Jun  4 05:39:24 2013<br>
> New Revision: 183218<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=183218&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=183218&view=rev</a><br>
> Log:<br>
> [asan] Fix invalid thread registry access when checking if LSan is disabled.<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: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_allocator2.cc?rev=183218&r1=183217&r2=183218&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_allocator2.cc?rev=183218&r1=183217&r2=183218&view=diff</a><br>

> ==============================================================================<br>
> --- compiler-rt/trunk/lib/asan/asan_allocator2.cc (original)<br>
> +++ compiler-rt/trunk/lib/asan/asan_allocator2.cc Tue Jun  4 05:39:24 2013<br>
> @@ -422,8 +422,10 @@ static void *Allocate(uptr size, uptr al<br>
>      uptr fill_size = Min(size, (uptr)fl.max_malloc_fill_size);<br>
>      REAL(memset)(res, fl.malloc_fill_byte, fill_size);<br>
>    }<br>
> -  m->lsan_tag =<br>
> -      t->lsan_disabled() ? __lsan::kSuppressed : __lsan::kDirectlyLeaked;<br>
> +  if (t && t->lsan_disabled())<br>
> +    m->lsan_tag = __lsan::kSuppressed;<br>
> +  else<br>
> +    m->lsan_tag = __lsan::kDirectlyLeaked;<br>
>    // Must be the last mutation of metadata in this function.<br>
>    atomic_store((atomic_uint8_t *)m, CHUNK_ALLOCATED, memory_order_release);<br>
>    ASAN_MALLOC_HOOK(res, size);<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>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Alexander Potapenko<br>
Software Engineer<br>
Google Moscow<br>
</font></span></blockquote></div><br></div>