Fix cute little bug that was causing the last
authorVikram S. Adve <vadve@cs.uiuc.edu>
Wed, 14 Nov 2001 21:24:44 +0000 (21:24 +0000)
committerVikram S. Adve <vadve@cs.uiuc.edu>
Wed, 14 Nov 2001 21:24:44 +0000 (21:24 +0000)
structure offset to be ignored in computing an offset!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1310 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/TargetData.cpp

index 0b4dc98233cb59b201daa80f4b749bd9e324fa55..02d18c21a5c8d7534d96c2aff033df66733ef4b8 100644 (file)
@@ -156,7 +156,7 @@ unsigned TargetData::getIndexedOffset(const Type *ptrTy,
   for (unsigned CurIDX = 0; CurIDX < Idx.size(); ++CurIDX) {
     if (const StructType *STy = dyn_cast<const StructType>(Ty)) {
       assert(Idx[CurIDX]->getType() == Type::UByteTy && "Illegal struct idx");
-      unsigned FieldNo = ((ConstPoolUInt*)Idx[CurIDX++])->getValue();
+      unsigned FieldNo = ((ConstPoolUInt*)Idx[CurIDX])->getValue();
 
       // Get structure layout information...
       const StructLayout *Layout = getStructLayout(STy);