[PATCH] D31295: Add free_on_realloc_zero=true flag for compatibility with allocators which allow a realloc(p, 0) and don't free the pointer.

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 23 11:44:32 PDT 2017


Ok. FWIW, this lgtm, but I haven't touched ASan before so it would help to get another +1.

vedant

> On Mar 23, 2017, at 11:43 AM, Filipe Cabecinhas <filcab+llvm.phabricator at gmail.com> wrote:
> 
> It is not detected by ASan, no. On `Allocator::Allocate`, we do a
> similar `if (size == 0) size = 1;`.
> 
> Thank you,
> Filipe
> 
> On Thu, Mar 23, 2017 at 6:41 PM, Vedant Kumar via Phabricator via
> llvm-commits <llvm-commits at lists.llvm.org> wrote:
>> vsk added a comment.
>> 
>> Ah, so is it also allowed to access `P[0]` under ASan after doing `P = malloc(0)`? If so, I can't spot any issues here.
>> 
>> 
>> https://reviews.llvm.org/D31295
>> 
>> 
>> 
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list