mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-12 14:06:36 +00:00
[opaque pointer type] Use the parsed explicit pointee type when error-checking geps during LL parsing
llvm-svn: 235233
This commit is contained in:
parent
027739a2e4
commit
b4d9ca022a
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user