]> granicus.if.org Git - llvm/commitdiff
[NFC] Added a comment to avoid possible confusion
authorDavid Bolvansky <david.bolvansky@gmail.com>
Wed, 28 Aug 2019 15:04:48 +0000 (15:04 +0000)
committerDavid Bolvansky <david.bolvansky@gmail.com>
Wed, 28 Aug 2019 15:04:48 +0000 (15:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370217 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/InstCombine/InstCombineCalls.cpp

index c3be8c4e9a90778a7bf2295f6cb74d0cea641812..d304f98ceaed1667967968ee67b9db0ae1bba104 100644 (file)
@@ -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(