[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.

Filipe Cabecinhas via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 23 11:43:21 PDT 2017

It is not detected by ASan, no. On `Allocator::Allocate`, we do a
similar `if (size == 0) size = 1;`.

Thank you,

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