diff --git a/lib/Transforms/TransformInternals.cpp b/lib/Transforms/TransformInternals.cpp index 51d5ff54c2b..62953f8c6d0 100644 --- a/lib/Transforms/TransformInternals.cpp +++ b/lib/Transforms/TransformInternals.cpp @@ -120,7 +120,7 @@ const Type *ConvertableToGEP(const Type *Ty, Value *OffsetVal, Offset -= ActualOffset; } else { const Type *ElTy = cast(CompTy)->getElementType(); - if (!ElTy->isSized()) + if (!ElTy->isSized() || (isa(CompTy) && !Indices.empty())) return 0; // Type is unreasonable... escape! unsigned ElSize = TD.getTypeSize(ElTy); int64_t ElSizeS = ElSize;