From 326e1fb77d1b5a074371379a6bb6f52d27f9bbd9 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 7 Jun 2003 21:45:42 +0000 Subject: [PATCH] Fix bug: LevelRaise/2003-06-07-EmptyArrayTest.ll llvm-svn: 6669 --- lib/Transforms/TransformInternals.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Transforms/TransformInternals.cpp b/lib/Transforms/TransformInternals.cpp index 56c03b991f0..7aa5564fbee 100644 --- a/lib/Transforms/TransformInternals.cpp +++ b/lib/Transforms/TransformInternals.cpp @@ -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(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);