[PATCH] D51317: Keep BumpPtrAllocator::Allocate(0) from returning nullptr

Hans Wennborg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 28 01:16:43 PDT 2018


hans added a comment.

In https://reviews.llvm.org/D51317#1214965, @jordan_rose wrote:

> I'm not sure whether it's better to do this or to remove `LLVM_ATTRIBUTE_RETURNS_NONNULL`. I'll defer to Hans or others on that, since I'm not a frequent LLVM contributor these days.


I don't think we should remove LLVM_ATTRIBUTE_RETURNS_NONNULL. But where do zero-size allocations come up? Maybe we should assert that's not allowed? The current patch won't return unique pointers, which the caller might expect.


Repository:
  rL LLVM

https://reviews.llvm.org/D51317





More information about the llvm-commits mailing list