Fix bug that was bugging bugpoint
authorChris Lattner <sabre@nondot.org>
Sat, 7 Dec 2002 21:27:16 +0000 (21:27 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 7 Dec 2002 21:27:16 +0000 (21:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4953 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/ValueMapper.cpp

index e6ab2974283f9893536dd467046795468752632b..517a3523389754a819cf0858ff17da808d646baf 100644 (file)
@@ -33,7 +33,7 @@ Value *MapValue(const Value *V, std::map<const Value*, Value*> &VM) {
           for (unsigned j = 0; j != i; ++j)
             Values.push_back(cast<Constant>(Vals[j]));
           Values.push_back(cast<Constant>(MV));
-          for (; i != e; ++i)
+          for (++i; i != e; ++i)
             Values.push_back(cast<Constant>(MapValue(Vals[i], VM)));
           return VMSlot = ConstantArray::get(CA->getType(), Values);
         }
@@ -53,7 +53,7 @@ Value *MapValue(const Value *V, std::map<const Value*, Value*> &VM) {
           for (unsigned j = 0; j != i; ++j)
             Values.push_back(cast<Constant>(Vals[j]));
           Values.push_back(cast<Constant>(MV));
-          for (; i != e; ++i)
+          for (++i; i != e; ++i)
             Values.push_back(cast<Constant>(MapValue(Vals[i], VM)));
           return VMSlot = ConstantStruct::get(CS->getType(), Values);
         }