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

llvm-svn: 5407
This commit is contained in:
Chris Lattner
2003-01-23 02:39:10 +00:00
parent c7a344d061
commit 6a3586b839

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;