[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
Tue Aug 27 12:29:38 PDT 2019


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


================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:4187
+    return;
+  if (isMallocLikeFn(&Call, TLI) && Op0C) {
+    Call.addAttribute(AttributeList::ReturnIndex,
----------------
jdoerfert wrote:
> You cannot remove the `isNullValue()` check here and below, Op1C could be the reason we skipped the return above!
Sorry, I dont know what is wrong here - newly added tests pass.

We dont need OP1C for malloc.


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

https://reviews.llvm.org/D66651





More information about the llvm-commits mailing list