diff options
author | David Blaikie <dblaikie@gmail.com> | 2015-04-17 22:32:13 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2015-04-17 22:32:13 +0000 |
commit | d33bad3e87ea0b6f49e716e81a668349ce19208f (patch) | |
tree | eba6750270c278124bfc40961c9a581c8a2b77f5 /llvm/lib/AsmParser | |
parent | 83f78a459a28705a2df8181d68cbfeaf4a30c0e0 (diff) | |
download | bcm5719-llvm-d33bad3e87ea0b6f49e716e81a668349ce19208f.tar.gz bcm5719-llvm-d33bad3e87ea0b6f49e716e81a668349ce19208f.zip |
[opaque pointer type] Use the parsed explicit pointee type when error-checking geps during LL parsing
llvm-svn: 235233
Diffstat (limited to 'llvm/lib/AsmParser')
-rw-r--r-- | llvm/lib/AsmParser/LLParser.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
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<const Type*, 4> 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<PointerType>(BaseType->getScalarType())->getElementType(), - Indices)) + if (!GetElementPtrInst::getIndexedType(Ty, Indices)) return Error(Loc, "invalid getelementptr indices"); Inst = GetElementPtrInst::Create(Ty, Ptr, Indices); if (InBounds) |