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

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 28 07:39:10 PDT 2019


jdoerfert added inline comments.


================
Comment at: llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp:4200
+                          Call.getContext(), Op1C->getZExtValue()));
+  } else if (isCallocLikeFn(&Call, TLI) && Op0C && Op1C) {
+    bool Overflow;
----------------
What if one is NULL but the other not? Will `getWithDereferenceableOrNullBytes(0)` do the right thing?


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