Fix bug: LevelRaise/2003-01-22-GEPProblem.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5407 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-01-23 02:39:10 +00:00
parent f3ce8b1a8e
commit e5fa63a578

View File

@ -120,7 +120,7 @@ const Type *ConvertableToGEP(const Type *Ty, Value *OffsetVal,
Offset -= ActualOffset;
} else {
const Type *ElTy = cast<SequentialType>(CompTy)->getElementType();
if (!ElTy->isSized())
if (!ElTy->isSized() || (isa<PointerType>(CompTy) && !Indices.empty()))
return 0; // Type is unreasonable... escape!
unsigned ElSize = TD.getTypeSize(ElTy);
int64_t ElSizeS = ElSize;