[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 12:37:26 PDT 2017


The standard says the behaviour is implementation defined, IIRC (I can
quote later).
It is a valid realloc implementation and we've seen people rely on this
(realloc returning a non null pointer for this situation). We need asan to
behave like our standard library (and its documentation).

I can keep this patch private if it's too much of a problem. I figured it
could be helpful for other people, though.

Thank you,

 Filipe



On Thu, 23 Mar 2017 at 19:05, Kostya Serebryany via Phabricator via
llvm-commits <llvm-commits at lists.llvm.org> wrote:

> kcc added a reviewer: alekseyshl.
> kcc added a comment.
>
> I am horrified by the amount of flags we already have, and would like to
> reduce it, not increase it.
> Can you please explain in more detaild why anyone would need this behavior
> and how this behavior matches the C/C++ standard behavior?
>
>
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170323/2c9490ef/attachment.html>


More information about the llvm-commits mailing list