Fix bug: LevelRaise/2003-06-07-EmptyArrayTest.ll
authorChris Lattner <sabre@nondot.org>
Sat, 7 Jun 2003 21:45:42 +0000 (21:45 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 7 Jun 2003 21:45:42 +0000 (21:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6669 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/TransformInternals.cpp

index 56c03b991f0abd514051b3c15f4df9e32336b440..7aa5564fbee13b6744b39b4248ad85bcddc1ca91 100644 (file)
@@ -56,7 +56,8 @@ const Type *getStructOffsetType(const Type *Ty, unsigned &Offset,
     ThisOffset = Offset;
     NextType = getStructOffsetStep(STy, ThisOffset, Indices, TD);
   } else if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
-    assert(Offset < TD.getTypeSize(ATy) && "Offset not in composite!");
+    assert(Offset == 0 || Offset < TD.getTypeSize(ATy) &&
+           "Offset not in composite!");
 
     NextType = ATy->getElementType();
     unsigned ChildSize = TD.getTypeSize(NextType);