[PATCH] D66651: Annotate return values of allocation functions with dereferenceable_or_null

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 23 06:52:58 PDT 2019


xbolva00 marked an inline comment as done.
xbolva00 added a comment.

I will update/add tests after some initial code review.



================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:4189
+    CI->addAttribute(AttributeList::ReturnIndex,
+                     Attribute::getWithDereferenceableBytes(
+                         CI->getContext(), Op0C->getZExtValue()));
----------------
Not a typo. OpNewLike never returns null, it just throws exception.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66651/new/

https://reviews.llvm.org/D66651





More information about the llvm-commits mailing list