aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/TransformInternals.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/TransformInternals.cpp b/lib/Transforms/TransformInternals.cpp
index a68cf87b2b..5117ce8dd5 100644
--- a/lib/Transforms/TransformInternals.cpp
+++ b/lib/Transforms/TransformInternals.cpp
@@ -231,7 +231,7 @@ const Type *ConvertableToGEP(const Type *Ty, Value *OffsetVal,
Indices.push_back(ConstantUInt::get(Type::UIntTy, Index));
Offset -= Index*ElSize; // Consume part of the offset
- } else if (!isa<PointerType>(CompTy) || CompTy == Ty) {
+ } else if (isa<ArrayType>(CompTy) || Indices.empty()) {
// Must be indexing a small amount into the first cell of the array
// Just index into element zero of the array here.
//