Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Commit

Permalink
[NFC] Added a comment to avoid possible confusion
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370217 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
davidbolvansky committed Aug 28, 2019
1 parent c30fd89 commit 8882971
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/Transforms/InstCombine/InstCombineCalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4183,8 +4183,10 @@ static void annotateAnyAllocSite(CallBase &Call, const TargetLibraryInfo *TLI) {
ConstantInt *Op1C = (Call.getNumArgOperands() == 1)
? nullptr
: dyn_cast<ConstantInt>(Call.getOperand(1));
// Bail out if the allocation size is zero.
if ((Op0C && Op0C->isNullValue()) || (Op1C && Op1C->isNullValue()))
return;

if (isMallocLikeFn(&Call, TLI) && Op0C) {
Call.addAttribute(AttributeList::ReturnIndex,
Attribute::getWithDereferenceableOrNullBytes(
Expand Down

0 comments on commit 8882971

Please sign in to comment.