mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-31 10:34:17 +00:00
[opaque pointer type] Use the parsed explicit pointee type when error-checking geps during LL parsing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235233 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7349765ddb
commit
72981cdce3
@ -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…
x
Reference in New Issue
Block a user