From d33bad3e87ea0b6f49e716e81a668349ce19208f Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 17 Apr 2015 22:32:13 +0000 Subject: [opaque pointer type] Use the parsed explicit pointee type when error-checking geps during LL parsing llvm-svn: 235233 --- llvm/lib/AsmParser/LLParser.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'llvm/lib/AsmParser/LLParser.cpp') diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index 546363b9cb1..be098c1b128 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -5542,13 +5542,10 @@ int LLParser::ParseGetElementPtr(Instruction *&Inst, PerFunctionState &PFS) { } SmallPtrSet Visited; - if (!Indices.empty() && - !BasePointerType->getElementType()->isSized(&Visited)) + if (!Indices.empty() && !Ty->isSized(&Visited)) return Error(Loc, "base element of getelementptr must be sized"); - if (!GetElementPtrInst::getIndexedType( - cast(BaseType->getScalarType())->getElementType(), - Indices)) + if (!GetElementPtrInst::getIndexedType(Ty, Indices)) return Error(Loc, "invalid getelementptr indices"); Inst = GetElementPtrInst::Create(Ty, Ptr, Indices); if (InBounds) -- cgit v1.2.3