OSDN Git Service

Assert we've found both vector types. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 14 Sep 2020 12:24:17 +0000 (13:24 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 14 Sep 2020 12:24:17 +0000 (13:24 +0100)
Fixes clang static analyzer warning about potential null dereferences.

llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp

index d800832..f36b341 100644 (file)
@@ -1062,6 +1062,7 @@ static Value *CheckAndCreateOffsetAdd(Value *X, Value *Y, Value *GEP,
     FixSummands(YElType, X);
     XElType = cast<FixedVectorType>(X->getType());
   }
+  assert(XElType && YElType && "Unknown vector types");
   // Check that the summands are of compatible types
   if (XElType != YElType) {
     LLVM_DEBUG(dbgs() << "masked gathers/scatters: incompatible gep offsets\n");