summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/IR/Verifier.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index fba78e92a09..bd9f3f3c3ea 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -2451,8 +2451,7 @@ void Verifier::visitGetElementPtrInst(GetElementPtrInst &GEP) {
Assert(isa<PointerType>(TargetTy),
"GEP base pointer is not a vector or a vector of pointers", &GEP);
- Assert(cast<PointerType>(TargetTy)->getElementType()->isSized(),
- "GEP into unsized type!", &GEP);
+ Assert(GEP.getSourceElementType()->isSized(), "GEP into unsized type!", &GEP);
Assert(GEP.getPointerOperandType()->isVectorTy() ==
GEP.getType()->isVectorTy(),
"Vector GEP must return a vector value", &GEP);
OpenPOWER on IntegriCloud