diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index 2e8008b96e7..64bf7cdc919 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -2849,8 +2849,7 @@ bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) { } SmallPtrSet Visited; - if (!Indices.empty() && - !BasePointerType->getElementType()->isSized(&Visited)) + if (!Indices.empty() && !Ty->isSized(&Visited)) return Error(ID.Loc, "base element of getelementptr must be sized"); if (!GetElementPtrInst::getIndexedType(Ty, Indices))